Fixed episode image path

pull/702/head
LukePulverenti Luke Pulverenti luke pulverenti 12 years ago
parent 76d365fcf9
commit d44f264ac0

@ -20,7 +20,7 @@ namespace MediaBrowser.Controller.Xml
public void Fetch(T item, string metadataFile)
{
// Use XmlReader for best performance
using (XmlReader reader = XmlReader.Create(metadataFile, new XmlReaderSettings() { }))
using (XmlReader reader = XmlReader.Create(metadataFile))
{
reader.MoveToContent();

@ -46,14 +46,22 @@ namespace MediaBrowser.TV.Providers
Path.Combine(metadataFolder, Path.ChangeExtension(episodeFileName, ".png"))
};
string image;
if (season == null)
{
// Gotta do this the slow way
item.PrimaryImagePath = imageFiles.FirstOrDefault(f => File.Exists(f));
image = imageFiles.FirstOrDefault(f => File.Exists(f));
}
else
{
item.PrimaryImagePath = imageFiles.FirstOrDefault(f => season.ContainsMetadataFile(f));
image = imageFiles.FirstOrDefault(f => season.ContainsMetadataFile(f));
}
// If we found something, set PrimaryImagePath
if (!string.IsNullOrEmpty(image))
{
item.PrimaryImagePath = image;
}
}
}

Loading…
Cancel
Save