Fix when MovieTitle is the empty string (should not occur, but what evs)

Fixes #1389
This commit is contained in:
Leonardo Galli 2017-04-16 00:26:16 +02:00
parent ef57882291
commit b26a036eed
1 changed files with 6 additions and 1 deletions

View File

@ -405,8 +405,13 @@ namespace NzbDrone.Core.Parser
if (result != null)
{
var languageTitle = simpleTitle;
if (result.MovieTitle.IsNotNullOrWhiteSpace() )
{
languageTitle = simpleTitle.Replace(result.MovieTitle, "A Movie");
}
result.Language = LanguageParser.ParseLanguage(simpleTitle.Replace(result.MovieTitle, "A Movie"));
result.Language = LanguageParser.ParseLanguage(languageTitle);
Logger.Debug("Language parsed: {0}", result.Language);
result.Quality = QualityParser.ParseQuality(title);