1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-23 22:25:14 -04:00

New: Parse original from release name when specified

(cherry picked from commit 88f4016fe0ed768f4206d04479156c45517f15b7)

Closes #10673
This commit is contained in:
Mark McDowall
2024-11-06 20:58:45 -08:00
committed by Bogdan
parent 78c009d6fa
commit 4a2202ed7f
2 changed files with 19 additions and 2 deletions
+9 -2
View File
@@ -37,7 +37,8 @@ namespace NzbDrone.Core.Parser
(?<vietnamese>\bVIE\b)|
(?<japanese>\bJPN\b)|
(?<korean>\bKOR\b)|
(?<urdu>\burdu\b)",
(?<urdu>\burdu\b)|
(?<original>\b(?:orig|original)\b)",
RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.IgnorePatternWhitespace);
private static readonly Regex CaseSensitiveLanguageRegex = new Regex(@"(?:(?i)(?<!SUB[\W|_|^]))(?:(?<lithuanian>\bLT\b)|
@@ -253,7 +254,7 @@ namespace NzbDrone.Core.Parser
languages.Add(Language.Tagalog);
}
// Case sensitive
// Case-sensitive
var caseSensitiveMatches = CaseSensitiveLanguageRegex.Matches(title);
foreach (Match match in caseSensitiveMatches)
@@ -294,6 +295,7 @@ namespace NzbDrone.Core.Parser
}
}
// Case-insensitive
var matches = LanguageRegex.Matches(title);
foreach (Match match in matches)
@@ -417,6 +419,11 @@ namespace NzbDrone.Core.Parser
{
languages.Add(Language.Urdu);
}
if (match.Groups["original"].Success)
{
languages.Add(Language.Original);
}
}
if (!languages.Any())