diff --git a/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs index 496ffe134..00c76beca 100644 --- a/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs @@ -159,6 +159,7 @@ namespace NzbDrone.Core.Test.ParserTests [TestCase("Mission Impossible: Rogue Nation 2012 Bluray", "")] [TestCase("Loving.Pablo.2018.TS.FRENCH.MD.x264-DROGUERiE", "")] [TestCase("Uncut.Gems.2019.720p.BluRay.x264-YOL0W", "")] + [TestCase("Directors.Cut.German.2006.COMPLETE.PAL.DVDR-LoD", "")] public void should_parse_edition(string postTitle, string edition) { var parsed = Parser.Parser.ParseMovieTitle(postTitle); diff --git a/src/NzbDrone.Core/MediaFiles/MovieImport/ImportApprovedMovie.cs b/src/NzbDrone.Core/MediaFiles/MovieImport/ImportApprovedMovie.cs index ac1144ebc..17464473b 100644 --- a/src/NzbDrone.Core/MediaFiles/MovieImport/ImportApprovedMovie.cs +++ b/src/NzbDrone.Core/MediaFiles/MovieImport/ImportApprovedMovie.cs @@ -189,7 +189,7 @@ namespace NzbDrone.Core.MediaFiles.MovieImport if (folderMovieInfo != null) { - var folderPath = path.GetAncestorPath(folderMovieInfo.SimpleReleaseTitle); + var folderPath = path.GetAncestorPath(folderMovieInfo.OriginalTitle); if (folderPath != null) { diff --git a/src/NzbDrone.Core/Parser/Model/ParsedMovieInfo.cs b/src/NzbDrone.Core/Parser/Model/ParsedMovieInfo.cs index 2fafb840d..935a9d78f 100644 --- a/src/NzbDrone.Core/Parser/Model/ParsedMovieInfo.cs +++ b/src/NzbDrone.Core/Parser/Model/ParsedMovieInfo.cs @@ -8,6 +8,8 @@ namespace NzbDrone.Core.Parser.Model public class ParsedMovieInfo { public string MovieTitle { get; set; } + public string OriginalTitle { get; set; } + public string ReleaseTitle { get; set; } public string SimpleReleaseTitle { get; set; } public QualityModel Quality { get; set; } public List Languages { get; set; } = new List(); diff --git a/src/NzbDrone.Core/Parser/Parser.cs b/src/NzbDrone.Core/Parser/Parser.cs index 0c9c438fa..0cd4b97ee 100644 --- a/src/NzbDrone.Core/Parser/Parser.cs +++ b/src/NzbDrone.Core/Parser/Parser.cs @@ -165,6 +165,7 @@ namespace NzbDrone.Core.Parser public static ParsedMovieInfo ParseMovieTitle(string title, bool isDir = false) { + var originalTitle = title; try { if (!ValidateBeforeParsing(title)) @@ -227,7 +228,7 @@ namespace NzbDrone.Core.Parser if (result != null) { //TODO: Add tests for this! - var simpleReleaseTitle = SimpleReleaseTitleRegex.Replace(title, string.Empty); + var simpleReleaseTitle = SimpleReleaseTitleRegex.Replace(releaseTitle, string.Empty); var simpleTitleReplaceString = match[0].Groups["title"].Success ? match[0].Groups["title"].Value : result.MovieTitle; @@ -247,7 +248,7 @@ namespace NzbDrone.Core.Parser result.Edition = ParseEdition(simpleReleaseTitle); } - result.ReleaseGroup = ParseReleaseGroup(releaseTitle); + result.ReleaseGroup = ParseReleaseGroup(simpleReleaseTitle); var subGroup = GetSubGroup(match); if (!subGroup.IsNullOrWhiteSpace()) @@ -263,6 +264,8 @@ namespace NzbDrone.Core.Parser Logger.Debug("Release Hash parsed: {0}", result.ReleaseHash); } + result.OriginalTitle = originalTitle; + result.ReleaseTitle = releaseTitle; result.SimpleReleaseTitle = simpleReleaseTitle; result.ImdbId = ParseImdbId(simpleReleaseTitle);