mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 20:12:41 +02:00
Fixed an issue where movies which were labelled with an alternative title could not be found.
Fixes #557 Fixes #1387 Probably fixes #1372, probably fixes #555
This commit is contained in:
parent
33b48eec95
commit
32a2407ad1
@ -129,7 +129,14 @@ private void Import(TrackedDownload trackedDownload)
|
||||
{
|
||||
var statusMessages = importResults
|
||||
.Where(v => v.Result != ImportResultType.Imported)
|
||||
.Select(v => new TrackedDownloadStatusMessage(Path.GetFileName(v.ImportDecision.LocalMovie.Path), v.Errors))
|
||||
.Select(v =>
|
||||
{
|
||||
if (v.ImportDecision.LocalMovie == null)
|
||||
{
|
||||
return new TrackedDownloadStatusMessage("", v.Errors);
|
||||
}
|
||||
return new TrackedDownloadStatusMessage(Path.GetFileName(v.ImportDecision.LocalMovie.Path), v.Errors);
|
||||
})
|
||||
.ToArray();
|
||||
|
||||
trackedDownload.Warn(statusMessages);
|
||||
|
@ -178,7 +178,7 @@ public Movie GetMovie(string title)
|
||||
return _movieService.FindByTitle(title);
|
||||
}
|
||||
|
||||
var movies = _movieService.FindByTitle(parsedMovieInfo.MovieTitle);
|
||||
var movies = _movieService.FindByTitle(parsedMovieInfo.MovieTitle, parsedMovieInfo.Year);
|
||||
|
||||
if (movies == null)
|
||||
{
|
||||
|
@ -240,18 +240,18 @@ private Movie FindByTitle(string cleanTitle, int? year)
|
||||
|
||||
IEnumerable<Movie> results = Query.Where(s => s.CleanTitle == cleanTitle);
|
||||
|
||||
if (results == null)
|
||||
if (results == null || results.Count() == 0)
|
||||
{
|
||||
results = Query.Where(movie => movie.CleanTitle == cleanTitleWithArabicNumbers) ??
|
||||
Query.Where(movie => movie.CleanTitle == cleanTitleWithRomanNumbers);
|
||||
|
||||
if (results == null)
|
||||
if (results == null || results.Count() == 0)
|
||||
{
|
||||
IEnumerable<Movie> movies = All();
|
||||
Func<string, string> titleCleaner = title => CoreParser.CleanSeriesTitle(title.ToLower());
|
||||
Func<IEnumerable<string>, string, bool> altTitleComparer =
|
||||
(alternativeTitles, atitle) =>
|
||||
alternativeTitles.Any(altTitle => altTitle == titleCleaner(atitle));
|
||||
alternativeTitles.Any(altTitle => titleCleaner(altTitle) == atitle);
|
||||
|
||||
results = movies.Where(m => altTitleComparer(m.AlternativeTitles, cleanTitle) ||
|
||||
altTitleComparer(m.AlternativeTitles, cleanTitleWithRomanNumbers) ||
|
||||
|
Loading…
Reference in New Issue
Block a user