@ -177,27 +177,26 @@ namespace NzbDrone.Core.Parser
public Movie GetMovie ( string title )
{
var parsed Episod eInfo = Parser . ParseMovieTitle ( title ) ;
var parsed Movi eInfo = Parser . ParseMovieTitle ( title ) ;
if ( parsed Episod eInfo = = null )
if ( parsed Movi eInfo = = null )
{
return _movieService . FindByTitle ( title ) ;
}
var series = _movieService . FindByTitle ( parsedEpisod eInfo. MovieTitle ) ;
var movies = _movieService . FindByTitle ( parsedMovi eInfo. MovieTitle ) ;
if ( ser ies = = null )
if ( mov ies = = null )
{
series = _movieService . FindByTitle ( parsedEpisodeInfo . MovieTitleInfo . TitleWithoutYear ,
parsedEpisodeInfo . MovieTitleInfo . Year ) ;
movies = _movieService . FindByTitle ( parsedMovieInfo . MovieTitleInfo . TitleWithoutYear , parsedMovieInfo . MovieTitleInfo . Year ) ;
}
if ( ser ies = = null )
if ( mov ies = = null )
{
series = _movieService . FindByTitle ( parsedEpisod eInfo. MovieTitle . Replace ( "DC" , "" ) . Trim ( ) ) ;
movies = _movieService . FindByTitle ( parsedMovi eInfo. MovieTitle . Replace ( "DC" , "" ) . Trim ( ) ) ;
}
return ser ies;
return mov ies;
}
public RemoteEpisode Map ( ParsedEpisodeInfo parsedEpisodeInfo , int tvdbId , int tvRageId , SearchCriteriaBase searchCriteria = null )
@ -220,23 +219,23 @@ namespace NzbDrone.Core.Parser
return remoteEpisode ;
}
public RemoteMovie Map ( ParsedMovieInfo parsed Episod eInfo, string imdbId , SearchCriteriaBase searchCriteria = null )
public RemoteMovie Map ( ParsedMovieInfo parsed Movi eInfo, string imdbId , SearchCriteriaBase searchCriteria = null )
{
var remote Episod e = new RemoteMovie
var remote Movi e = new RemoteMovie
{
ParsedMovieInfo = parsed Episod eInfo,
ParsedMovieInfo = parsed Movi eInfo,
} ;
var movie = GetMovie ( parsed Episod eInfo, imdbId , searchCriteria ) ;
var movie = GetMovie ( parsed Movi eInfo, imdbId , searchCriteria ) ;
if ( movie = = null )
{
return remote Episod e;
return remote Movi e;
}
remote Episod e. Movie = movie ;
remote Movi e. Movie = movie ;
return remote Episod e;
return remote Movi e;
}
public RemoteEpisode Map ( ParsedEpisodeInfo parsedEpisodeInfo , int seriesId , IEnumerable < int > episodeIds )
@ -353,7 +352,7 @@ namespace NzbDrone.Core.Parser
return null ;
}
private Movie GetMovie ( ParsedMovieInfo parsed Episod eInfo, string imdbId , SearchCriteriaBase searchCriteria )
private Movie GetMovie ( ParsedMovieInfo parsed Movi eInfo, string imdbId , SearchCriteriaBase searchCriteria )
{
if ( searchCriteria ! = null )
{
@ -370,7 +369,7 @@ namespace NzbDrone.Core.Parser
foreach ( string title in possibleTitles )
{
if ( title = = parsed Episod eInfo. MovieTitle . CleanSeriesTitle ( ) )
if ( title = = parsed Movi eInfo. MovieTitle . CleanSeriesTitle ( ) )
{
possibleMovie = searchCriteria . Movie ;
}
@ -380,19 +379,19 @@ namespace NzbDrone.Core.Parser
string num = entry . Key ;
string roman = entry . Value . ToLower ( ) ;
if ( title . Replace ( num , roman ) = = parsed Episod eInfo. MovieTitle . CleanSeriesTitle ( ) )
if ( title . Replace ( num , roman ) = = parsed Movi eInfo. MovieTitle . CleanSeriesTitle ( ) )
{
possibleMovie = searchCriteria . Movie ;
}
if ( title . Replace ( roman , num ) = = parsed Episod eInfo. MovieTitle . CleanSeriesTitle ( ) )
if ( title . Replace ( roman , num ) = = parsed Movi eInfo. MovieTitle . CleanSeriesTitle ( ) )
{
possibleMovie = searchCriteria . Movie ;
}
}
}
if ( possibleMovie ! = null & & ( parsed Episod eInfo. Year < 1800 | | possibleMovie . Year = = parsed Episod eInfo. Year ) )
if ( possibleMovie ! = null & & ( parsed Movi eInfo. Year < 1800 | | possibleMovie . Year = = parsed Movi eInfo. Year ) )
{
return possibleMovie ;
}
@ -404,21 +403,20 @@ namespace NzbDrone.Core.Parser
if ( searchCriteria = = null )
{
if ( parsed Episod eInfo. Year > 1900 )
if ( parsed Movi eInfo. Year > 1900 )
{
movie = _movieService . FindByTitle ( parsedEpisodeInfo . MovieTitle , parsedEpisodeInfo . Year ) ;
movie = _movieService . FindByTitle ( parsedMovieInfo . MovieTitle , parsedMovieInfo . Year ) ;
}
else
{
movie = _movieService . FindByTitle ( parsed Episod eInfo. MovieTitle ) ;
movie = _movieService . FindByTitle ( parsed Movi eInfo. MovieTitle ) ;
}
if ( movie = = null )
{
movie = _movieService . FindByTitle ( parsed Episod eInfo. MovieTitle ) ;
movie = _movieService . FindByTitle ( parsed Movi eInfo. MovieTitle ) ;
}
return movie ;
// return movie ;
}
@ -430,7 +428,7 @@ namespace NzbDrone.Core.Parser
if ( movie = = null )
{
_logger . Debug ( "No matching movie {0}", parsedEpisodeInfo . MovieTitle ) ;
_logger . Debug ( $"No matching movie {parsedMovieInfo.MovieTitle}" ) ;
return null ;
}