|
|
|
@ -355,11 +355,14 @@ namespace NzbDrone.Core.Parser
|
|
|
|
|
|
|
|
|
|
private Movie GetMovie(ParsedMovieInfo parsedEpisodeInfo, string imdbId, SearchCriteriaBase searchCriteria)
|
|
|
|
|
{
|
|
|
|
|
Movie possibleMovie = null;
|
|
|
|
|
if (searchCriteria != null)
|
|
|
|
|
{
|
|
|
|
|
var possibleTitles = new List<string>();
|
|
|
|
|
|
|
|
|
|
Movie possibleMovie = null;
|
|
|
|
|
|
|
|
|
|
possibleTitles.Add(searchCriteria.Movie.CleanTitle);
|
|
|
|
|
|
|
|
|
|
foreach (string altTitle in searchCriteria.Movie.AlternativeTitles)
|
|
|
|
|
{
|
|
|
|
|
possibleTitles.Add(altTitle.CleanSeriesTitle());
|
|
|
|
@ -389,50 +392,49 @@ namespace NzbDrone.Core.Parser
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (possibleMovie != null && (parsedEpisodeInfo.Year < 1800 || possibleMovie.Year == parsedEpisodeInfo.Year))
|
|
|
|
|
{
|
|
|
|
|
return possibleMovie;
|
|
|
|
|
}
|
|
|
|
|
if (possibleMovie != null && (parsedEpisodeInfo.Year < 1800 || possibleMovie.Year == parsedEpisodeInfo.Year))
|
|
|
|
|
{
|
|
|
|
|
return possibleMovie;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
|
|
|
|
|
Movie movie = null;
|
|
|
|
|
|
|
|
|
|
if (searchCriteria == null)
|
|
|
|
|
{
|
|
|
|
|
// search by title and year
|
|
|
|
|
if (parsedEpisodeInfo.Year > 1900)
|
|
|
|
|
{
|
|
|
|
|
possibleMovie = _movieService.FindByTitle(parsedEpisodeInfo.MovieTitle, parsedEpisodeInfo.Year);
|
|
|
|
|
movie = _movieService.FindByTitle(parsedEpisodeInfo.MovieTitle, parsedEpisodeInfo.Year);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// search by title
|
|
|
|
|
possibleMovie = _movieService.FindByTitle(parsedEpisodeInfo.MovieTitle);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// search by title
|
|
|
|
|
if (possibleMovie == null)
|
|
|
|
|
{
|
|
|
|
|
possibleMovie = _movieService.FindByTitle(parsedEpisodeInfo.MovieTitle);
|
|
|
|
|
movie = _movieService.FindByTitle(parsedEpisodeInfo.MovieTitle);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// search by alternative titles
|
|
|
|
|
if (possibleMovie == null)
|
|
|
|
|
if (movie == null)
|
|
|
|
|
{
|
|
|
|
|
possibleMovie = _movieService.FindByAlternativeTitle(parsedEpisodeInfo.MovieTitle);
|
|
|
|
|
movie = _movieService.FindByTitle(parsedEpisodeInfo.MovieTitle);
|
|
|
|
|
}
|
|
|
|
|
return movie;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (possibleMovie == null && imdbId.IsNotNullOrWhiteSpace())
|
|
|
|
|
|
|
|
|
|
if (movie == null && imdbId.IsNotNullOrWhiteSpace())
|
|
|
|
|
{
|
|
|
|
|
possibleMovie = _movieService.FindByImdbId(imdbId);
|
|
|
|
|
movie = _movieService.FindByImdbId(imdbId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (possibleMovie == null)
|
|
|
|
|
if (movie == null)
|
|
|
|
|
{
|
|
|
|
|
_logger.Error($"Unable to match movie {parsedEpisodeInfo.MovieTitle}, try adding a alternative title to themoviedb.org for this movie.");
|
|
|
|
|
_logger.Debug("No matching movie {0}", parsedEpisodeInfo.MovieTitle);
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return possibleMovie;
|
|
|
|
|
return movie;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Series GetSeries(ParsedEpisodeInfo parsedEpisodeInfo, int tvdbId, int tvRageId, SearchCriteriaBase searchCriteria)
|
|
|
|
|