Fixed: Only replace the Title instance of a release

For movies such as X (2022) we don't want to replace every instance of `X` in the release string, but only the instance we identify as the title.
pull/7672/head
Qstick 2 years ago
parent b9f2b3e06f
commit a8362511f9

@ -264,9 +264,17 @@ namespace NzbDrone.Core.Parser
var simpleTitleReplaceString = match[0].Groups["title"].Success ? match[0].Groups["title"].Value : result.PrimaryMovieTitle; var simpleTitleReplaceString = match[0].Groups["title"].Success ? match[0].Groups["title"].Value : result.PrimaryMovieTitle;
if (simpleTitleReplaceString.IsNotNullOrWhiteSpace()) if (simpleTitleReplaceString.IsNotNullOrWhiteSpace())
{
if (match[0].Groups["title"].Success)
{
simpleReleaseTitle = simpleReleaseTitle.Remove(match[0].Groups["title"].Index, match[0].Groups["title"].Length)
.Insert(match[0].Groups["title"].Index, simpleTitleReplaceString.Contains(".") ? "A.Movie" : "A Movie");
}
else
{ {
simpleReleaseTitle = simpleReleaseTitle.Replace(simpleTitleReplaceString, simpleTitleReplaceString.Contains(".") ? "A.Movie" : "A Movie"); simpleReleaseTitle = simpleReleaseTitle.Replace(simpleTitleReplaceString, simpleTitleReplaceString.Contains(".") ? "A.Movie" : "A Movie");
} }
}
result.ReleaseGroup = ParseReleaseGroup(simpleReleaseTitle); result.ReleaseGroup = ParseReleaseGroup(simpleReleaseTitle);

Loading…
Cancel
Save