1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-23 02:05:27 +02:00

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 dba3a82439
commit 5034d83062
2 changed files with 18 additions and 2 deletions

View File

@ -131,7 +131,15 @@ public override List<ImageFileResult> EpisodeImages(Series series, EpisodeFile e
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 @@ public override List<ImageFileResult> EpisodeImages(Series series, EpisodeFile e
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)
{