mirror of
https://github.com/Radarr/Radarr
synced 2026-02-11 17:22:07 +01: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:
parent
a6c2b2e039
commit
e59257f457
4 changed files with 9 additions and 3 deletions
|
|
@ -159,6 +159,7 @@ public void should_parse_movie_year(string postTitle, int year)
|
|||
[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 @@ private string GetOriginalFilePath(DownloadClientItem downloadClientItem, LocalM
|
|||
|
||||
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 @@ public static ParsedMovieInfo ParseMoviePath(string path)
|
|||
|
||||
public static ParsedMovieInfo ParseMovieTitle(string title, bool isDir = false)
|
||||
{
|
||||
var originalTitle = title;
|
||||
try
|
||||
{
|
||||
if (!ValidateBeforeParsing(title))
|
||||
|
|
@ -227,7 +228,7 @@ public static ParsedMovieInfo ParseMovieTitle(string title, bool isDir = false)
|
|||
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 @@ public static ParsedMovieInfo ParseMovieTitle(string title, bool isDir = false)
|
|||
result.Edition = ParseEdition(simpleReleaseTitle);
|
||||
}
|
||||
|
||||
result.ReleaseGroup = ParseReleaseGroup(releaseTitle);
|
||||
result.ReleaseGroup = ParseReleaseGroup(simpleReleaseTitle);
|
||||
|
||||
var subGroup = GetSubGroup(match);
|
||||
if (!subGroup.IsNullOrWhiteSpace())
|
||||
|
|
@ -263,6 +264,8 @@ public static ParsedMovieInfo ParseMovieTitle(string title, bool isDir = false)
|
|||
Logger.Debug("Release Hash parsed: {0}", result.ReleaseHash);
|
||||
}
|
||||
|
||||
result.OriginalTitle = originalTitle;
|
||||
result.ReleaseTitle = releaseTitle;
|
||||
result.SimpleReleaseTitle = simpleReleaseTitle;
|
||||
|
||||
result.ImdbId = ParseImdbId(simpleReleaseTitle);
|
||||
|
|
|
|||
Loading…
Reference in a new issue