Fixed: Kometa and Kodi metadata failing with duplicate episode files

Closes #7381
This commit is contained in:
Mark McDowall 2024-11-18 17:00:00 -08:00
parent ca0bb14027
commit bbd9f0f545
2 changed files with 18 additions and 2 deletions

View File

@ -131,7 +131,15 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Kometa
try
{
var screenshot = episodeFile.Episodes.Value.First().Images.SingleOrDefault(i => i.CoverType == MediaCoverTypes.Screenshot);
var firstEpisode = episodeFile.Episodes.Value.FirstOrDefault();
if (firstEpisode == null)
{
_logger.Debug("Episode file has no associated episodes, potentially a duplicate file");
return new List<ImageFileResult>();
}
var screenshot = firstEpisode.Images.SingleOrDefault(i => i.CoverType == MediaCoverTypes.Screenshot);
if (screenshot == null)
{

View File

@ -421,7 +421,15 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Xbmc
try
{
var screenshot = episodeFile.Episodes.Value.First().Images.SingleOrDefault(i => i.CoverType == MediaCoverTypes.Screenshot);
var firstEpisode = episodeFile.Episodes.Value.FirstOrDefault();
if (firstEpisode == null)
{
_logger.Debug("Episode file has no associated episodes, potentially a duplicate file");
return new List<ImageFileResult>();
}
var screenshot = firstEpisode.Images.SingleOrDefault(i => i.CoverType == MediaCoverTypes.Screenshot);
if (screenshot == null)
{