Fixed: Correctly map movie by original title on import

Fixes #7348
pull/7485/head
Qstick 2 years ago
parent d8891ee4ea
commit 886b9b1c05

@ -119,10 +119,18 @@ namespace NzbDrone.Core.Movies
return FindByTitle(new List<string> { title }, year, otherTitles, candidates); return FindByTitle(new List<string> { title }, year, otherTitles, candidates);
} }
public Movie FindByTitle(List<string> cleanTitles, int? year, List<string> otherTitles, List<Movie> candidates) public Movie FindByTitle(List<string> titles, int? year, List<string> otherTitles, List<Movie> candidates)
{ {
var cleanTitles = titles.Select(t => t.CleanMovieTitle().ToLowerInvariant());
var result = candidates.Where(x => cleanTitles.Contains(x.MovieMetadata.Value.CleanTitle)).FirstWithYear(year); 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) if (result == null)
{ {
result = result =

Loading…
Cancel
Save