mirror of
https://github.com/Radarr/Radarr.git
synced 2024-08-19 00:39:41 +02:00
parent
d8891ee4ea
commit
886b9b1c05
@ -119,10 +119,18 @@ public Movie FindByTitle(string title, int year)
|
||||
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);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
result =
|
||||
candidates.Where(movie => cleanTitles.Contains(movie.MovieMetadata.Value.CleanOriginalTitle)).FirstWithYear(year);
|
||||
}
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
result =
|
||||
|
Loading…
Reference in New Issue
Block a user