diff --git a/MediaBrowser.Controller/Xml/BaseItemXmlParser.cs b/MediaBrowser.Controller/Xml/BaseItemXmlParser.cs index a97227485..f5eecbcde 100644 --- a/MediaBrowser.Controller/Xml/BaseItemXmlParser.cs +++ b/MediaBrowser.Controller/Xml/BaseItemXmlParser.cs @@ -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(); diff --git a/MediaBrowser.TV/Providers/EpisodeImageFromMediaLocationProvider.cs b/MediaBrowser.TV/Providers/EpisodeImageFromMediaLocationProvider.cs index 131571a36..b98cee2ef 100644 --- a/MediaBrowser.TV/Providers/EpisodeImageFromMediaLocationProvider.cs +++ b/MediaBrowser.TV/Providers/EpisodeImageFromMediaLocationProvider.cs @@ -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; } } }