mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-17 21:44:48 -04:00
Fixed: correctly replacing SimpleReleaseTitle by A Movie. This resolves a lot of cases where a wrong language or edition has been parsed because it has parsed a part of the movie title (also applies to custom formats parsing)
This commit is contained in:
committed by
Qstick
parent
a6c2b2e039
commit
e59257f457
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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<Language> Languages { get; set; } = new List<Language>();
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user