1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2025-01-17 10:45:49 +02:00

Fixed: Log matching scene mapping for title

This commit is contained in:
Mark McDowall 2019-10-07 09:40:26 -07:00
parent 3baed292e1
commit f0c90a4744

View File

@ -104,9 +104,16 @@ public SceneMapping FindSceneMapping(string seriesTitle, string releaseTitle)
var distinctMappings = mappings.DistinctBy(v => v.TvdbId).ToList();
if (distinctMappings.Count <= 1)
if (distinctMappings.Count == 0)
{
return distinctMappings.FirstOrDefault();
return null;
}
if (distinctMappings.Count == 1)
{
var mapping = distinctMappings.First();
_logger.Debug("Found scene mapping for: {0}. TVDB ID for mapping: {1}", seriesTitle, mapping.TvdbId);
return distinctMappings.First();
}
throw new InvalidSceneMappingException(mappings, releaseTitle);