From b2526a136c78d995402cd23eaa580a1ab03503a0 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Tue, 9 Sep 2014 19:04:25 -0700 Subject: [PATCH] More logging when episode file image can't be found for XBMC metadata --- .../MetaData/Consumers/Xbmc/XbmcMetadata.cs | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/NzbDrone.Core/MetaData/Consumers/Xbmc/XbmcMetadata.cs b/src/NzbDrone.Core/MetaData/Consumers/Xbmc/XbmcMetadata.cs index fec560745..7e872c1ff 100644 --- a/src/NzbDrone.Core/MetaData/Consumers/Xbmc/XbmcMetadata.cs +++ b/src/NzbDrone.Core/MetaData/Consumers/Xbmc/XbmcMetadata.cs @@ -296,18 +296,27 @@ namespace NzbDrone.Core.Metadata.Consumers.Xbmc return new List(); } - var screenshot = episodeFile.Episodes.Value.First().Images.SingleOrDefault(i => i.CoverType == MediaCoverTypes.Screenshot); - - if (screenshot == null) + try { - _logger.Debug("Episode screenshot not available"); - return null; - } + var screenshot = episodeFile.Episodes.Value.First().Images.SingleOrDefault(i => i.CoverType == MediaCoverTypes.Screenshot); - return new List + if (screenshot == null) + { + _logger.Debug("Episode screenshot not available"); + return null; + } + + return new List { new ImageFileResult(GetEpisodeImageFilename(episodeFile.RelativePath), screenshot.Url) }; + } + catch (Exception ex) + { + _logger.Error("Unable to episode image for file: " + Path.Combine(series.Path, episodeFile.RelativePath), ex); + + return new List(); + } } private IEnumerable ProcessSeriesImages(Series series)