mirror of
https://github.com/Radarr/Radarr
synced 2025-12-06 08:28:50 +01:00
parent
d8891ee4ea
commit
886b9b1c05
1 changed files with 9 additions and 1 deletions
|
|
@ -119,10 +119,18 @@ public Movie FindByTitle(string title, int year)
|
||||||
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…
Reference in a new issue