1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-27 22:57:09 -04:00

Add PreSubstitutionRegex Capabilities

Fixes #7389
This commit is contained in:
Qstick
2022-11-20 12:12:07 -06:00
parent ae8245c3c5
commit d37fac5343
2 changed files with 17 additions and 1 deletions
+11
View File
@@ -18,6 +18,8 @@ namespace NzbDrone.Core.Parser
private static readonly Regex ReportEditionRegex = new Regex(@"^.+?" + EditionRegex, RegexOptions.Compiled | RegexOptions.IgnoreCase);
private static readonly RegexReplace[] PreSubstitutionRegex = Array.Empty<RegexReplace>();
private static readonly Regex[] ReportMovieTitleRegex = new[]
{
//Anime [Subgroup] and Year
@@ -220,6 +222,15 @@ namespace NzbDrone.Core.Parser
releaseTitle = releaseTitle.Replace("【", "[").Replace("】", "]");
foreach (var replace in PreSubstitutionRegex)
{
if (replace.TryReplace(ref releaseTitle))
{
Logger.Trace($"Replace regex: {replace}");
Logger.Debug("Substituted with " + releaseTitle);
}
}
var simpleTitle = SimpleTitleRegex.Replace(releaseTitle);
// TODO: Quick fix stripping [url] - prefixes.