mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-24 22:35:49 -04:00
Fixed: Parsing alternative titles containing "A.K.A."
This commit is contained in:
@@ -105,6 +105,8 @@ namespace NzbDrone.Core.Parser
|
||||
// Regex to unbracket alternative titles.
|
||||
private static readonly Regex BracketedAlternativeTitleRegex = new Regex(@"(.*) \([ ]*AKA[ ]+(.*)\)", RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
|
||||
private static readonly Regex NormalizeAlternativeTitleRegex = new Regex(@"[ ]+(?:A\.K\.A\.)[ ]+", RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
|
||||
private static readonly Regex NormalizeRegex = new Regex(@"((?:\b|_)(?<!^|[^a-zA-Z0-9_']\w[^a-zA-Z0-9_'])(a(?!$|[^a-zA-Z0-9_']\w[^a-zA-Z0-9_'])|an|the|and|or|of)(?!$)(?:\b|_))|\W|_",
|
||||
RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
|
||||
@@ -590,6 +592,7 @@ namespace NzbDrone.Core.Parser
|
||||
}
|
||||
|
||||
var movieName = matchCollection[0].Groups["title"].Value.Replace('_', ' ');
|
||||
movieName = NormalizeAlternativeTitleRegex.Replace(movieName, " AKA ");
|
||||
movieName = RequestInfoRegex.Replace(movieName, "").Trim(' ');
|
||||
|
||||
var parts = movieName.Split('.');
|
||||
|
||||
Reference in New Issue
Block a user