fixes #161 - Images not being displayed (correctly) in Views in DashBoard

This commit is contained in:
Luke Pulverenti 2013-04-18 11:56:50 -04:00
parent e86a8d4ef5
commit a8d8c598ca

View File

@ -48,7 +48,7 @@ namespace MediaBrowser.Controller.Providers.TV
case "filename":
{
string filename = reader.ReadElementContentAsString();
var filename = reader.ReadElementContentAsString();
if (!string.IsNullOrWhiteSpace(filename))
{
@ -56,8 +56,13 @@ namespace MediaBrowser.Controller.Providers.TV
// even though it's actually using the metadata folder.
filename = Path.GetFileName(filename);
string seasonFolder = Path.GetDirectoryName(item.Path);
item.PrimaryImagePath = Path.Combine(seasonFolder, "metadata", filename);
var seasonFolder = Path.GetDirectoryName(item.Path);
filename = Path.Combine(seasonFolder, "metadata", filename);
if (File.Exists(filename))
{
item.PrimaryImagePath = filename;
}
}
break;
}