Fixed: #4394 parsing multi language from ReleaseGroup name

pull/2/head
Gabriel Patzleiner 5 years ago committed by Qstick
parent 40b630ef10
commit 57961df1df

@ -174,6 +174,23 @@ namespace NzbDrone.Core.Test.ParserTests
parsed.Languages.First().Should().Be(Language.English); parsed.Languages.First().Should().Be(Language.English);
} }
[TestCase("The.Purge.3.Election.Year.2016.German.DTS.DL.720p.BluRay.x264-MULTiPLEX")]
public void should_not_parse_multi_language_in_releasegroup(string postTitle)
{
var parsed = Parser.Parser.ParseMovieTitle(postTitle, true);
parsed.Languages.Count().Should().Be(1);
parsed.Languages.First().Should().Be(Language.German);
}
[TestCase("The.Purge.3.Election.Year.2016.German.Multi.DTS.DL.720p.BluRay.x264-MULTiPLEX")]
public void should_parse_multi_language(string postTitle)
{
var parsed = Parser.Parser.ParseMovieTitle(postTitle, true);
parsed.Languages.Count().Should().Be(2);
parsed.Languages.Should().Contain(Language.German);
parsed.Languages.Should().Contain(Language.English, "Added by the multi tag in the release name");
}
[TestCase("The Italian Job 2008 [tt1234567] 720p BluRay X264", "tt1234567")] [TestCase("The Italian Job 2008 [tt1234567] 720p BluRay X264", "tt1234567")]
[TestCase("The Italian Job 2008 [tt12345678] 720p BluRay X264", "tt12345678")] [TestCase("The Italian Job 2008 [tt12345678] 720p BluRay X264", "tt12345678")]
public void should_parse_imdb_in_title(string postTitle, string imdb) public void should_parse_imdb_in_title(string postTitle, string imdb)

@ -240,17 +240,6 @@ namespace NzbDrone.Core.Parser
simpleReleaseTitle = simpleReleaseTitle.Replace(simpleTitleReplaceString, simpleTitleReplaceString.Contains(".") ? "A.Movie" : "A Movie"); simpleReleaseTitle = simpleReleaseTitle.Replace(simpleTitleReplaceString, simpleTitleReplaceString.Contains(".") ? "A.Movie" : "A Movie");
} }
result.Languages = LanguageParser.ParseLanguages(simpleReleaseTitle);
Logger.Debug("Languages parsed: {0}", string.Join(", ", result.Languages));
result.Quality = QualityParser.ParseQuality(title);
Logger.Debug("Quality parsed: {0}", result.Quality);
if (result.Edition.IsNullOrWhiteSpace())
{
result.Edition = ParseEdition(simpleReleaseTitle);
}
result.ReleaseGroup = ParseReleaseGroup(simpleReleaseTitle); result.ReleaseGroup = ParseReleaseGroup(simpleReleaseTitle);
var subGroup = GetSubGroup(match); var subGroup = GetSubGroup(match);
@ -261,6 +250,18 @@ namespace NzbDrone.Core.Parser
Logger.Debug("Release Group parsed: {0}", result.ReleaseGroup); Logger.Debug("Release Group parsed: {0}", result.ReleaseGroup);
result.Languages = LanguageParser.ParseLanguages(result.ReleaseGroup.IsNotNullOrWhiteSpace() ? simpleReleaseTitle.Replace(result.ReleaseGroup, "RlsGrp") : simpleReleaseTitle);
Logger.Debug("Languages parsed: {0}", string.Join(", ", result.Languages));
result.Quality = QualityParser.ParseQuality(title);
Logger.Debug("Quality parsed: {0}", result.Quality);
if (result.Edition.IsNullOrWhiteSpace())
{
result.Edition = ParseEdition(simpleReleaseTitle);
Logger.Debug("Edition parsed: {0}", result.Edition);
}
result.ReleaseHash = GetReleaseHash(match); result.ReleaseHash = GetReleaseHash(match);
if (!result.ReleaseHash.IsNullOrWhiteSpace()) if (!result.ReleaseHash.IsNullOrWhiteSpace())
{ {

Loading…
Cancel
Save