From a8362511f954cb00d2d6e55caaa6683b03ba8c3e Mon Sep 17 00:00:00 2001 From: Qstick Date: Sun, 9 Oct 2022 00:46:19 -0500 Subject: [PATCH] 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. --- src/NzbDrone.Core/Parser/Parser.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/Parser/Parser.cs b/src/NzbDrone.Core/Parser/Parser.cs index bcf908ff5..4d68c632d 100644 --- a/src/NzbDrone.Core/Parser/Parser.cs +++ b/src/NzbDrone.Core/Parser/Parser.cs @@ -265,7 +265,15 @@ namespace NzbDrone.Core.Parser if (simpleTitleReplaceString.IsNotNullOrWhiteSpace()) { - simpleReleaseTitle = simpleReleaseTitle.Replace(simpleTitleReplaceString, simpleTitleReplaceString.Contains(".") ? "A.Movie" : "A Movie"); + 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"); + } } result.ReleaseGroup = ParseReleaseGroup(simpleReleaseTitle);