From 886b9b1c05a0bedd0b02808b0677bcd2df696efe Mon Sep 17 00:00:00 2001 From: Qstick Date: Mon, 15 Aug 2022 23:16:22 -0500 Subject: [PATCH] Fixed: Correctly map movie by original title on import Fixes #7348 --- src/NzbDrone.Core/Movies/MovieService.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/Movies/MovieService.cs b/src/NzbDrone.Core/Movies/MovieService.cs index 14bbc34c9..473bf64d6 100644 --- a/src/NzbDrone.Core/Movies/MovieService.cs +++ b/src/NzbDrone.Core/Movies/MovieService.cs @@ -119,10 +119,18 @@ namespace NzbDrone.Core.Movies return FindByTitle(new List { title }, year, otherTitles, candidates); } - public Movie FindByTitle(List cleanTitles, int? year, List otherTitles, List candidates) + public Movie FindByTitle(List titles, int? year, List otherTitles, List candidates) { + var cleanTitles = titles.Select(t => t.CleanMovieTitle().ToLowerInvariant()); + var result = candidates.Where(x => cleanTitles.Contains(x.MovieMetadata.Value.CleanTitle)).FirstWithYear(year); + if (result == null) + { + result = + candidates.Where(movie => cleanTitles.Contains(movie.MovieMetadata.Value.CleanOriginalTitle)).FirstWithYear(year); + } + if (result == null) { result =