mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-19 17:32:38 +01:00
parent
ae8245c3c5
commit
d37fac5343
@ -18,6 +18,8 @@ public static class Parser
|
|||||||
|
|
||||||
private static readonly Regex ReportEditionRegex = new Regex(@"^.+?" + EditionRegex, RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
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[]
|
private static readonly Regex[] ReportMovieTitleRegex = new[]
|
||||||
{
|
{
|
||||||
//Anime [Subgroup] and Year
|
//Anime [Subgroup] and Year
|
||||||
@ -220,6 +222,15 @@ public static ParsedMovieInfo ParseMovieTitle(string title, bool isDir = false)
|
|||||||
|
|
||||||
releaseTitle = releaseTitle.Replace("【", "[").Replace("】", "]");
|
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);
|
var simpleTitle = SimpleTitleRegex.Replace(releaseTitle);
|
||||||
|
|
||||||
// TODO: Quick fix stripping [url] - prefixes.
|
// TODO: Quick fix stripping [url] - prefixes.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
namespace NzbDrone.Core.Parser
|
namespace NzbDrone.Core.Parser
|
||||||
{
|
{
|
||||||
@ -46,5 +46,10 @@ public bool TryReplace(ref string input)
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return _regex.ToString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user