mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
Merge branch 'master' into quality
This commit is contained in:
commit
b40c6ba7b8
5 changed files with 47 additions and 47 deletions
|
@ -74,8 +74,14 @@ namespace NzbDrone.Core
|
|||
private static readonly Regex ReportSizeRegex = new Regex(@"(?<value>\d+\.\d{1,2}|\d+\,\d+\.\d{1,2})\W?(?<unit>GB|MB|GiB|MiB)",
|
||||
RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
|
||||
private static readonly Regex HeaderRegex = new Regex(@"(?:\[.+\]\-\[.+\]\-\[.+\]\-\[)(?<nzbTitle>.+)(?:\]\-.+)",
|
||||
RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
private static readonly Regex[] HeaderRegex = new[]
|
||||
{
|
||||
new Regex(@"(?:\[.+\]\-\[.+\]\-\[.+\]\-\[)(?<nzbTitle>.+)(?:\]\-.+)",
|
||||
RegexOptions.IgnoreCase | RegexOptions.Compiled),
|
||||
|
||||
new Regex(@"(?:\[)(?<nzbTitle>.+)(?:\]\-.+)",
|
||||
RegexOptions.IgnoreCase | RegexOptions.Compiled),
|
||||
};
|
||||
|
||||
internal static EpisodeParseResult ParsePath(string path)
|
||||
{
|
||||
|
@ -480,10 +486,13 @@ namespace NzbDrone.Core
|
|||
|
||||
internal static string ParseHeader(string header)
|
||||
{
|
||||
var match = HeaderRegex.Matches(header);
|
||||
foreach(var regex in HeaderRegex)
|
||||
{
|
||||
var match = regex.Matches(header);
|
||||
|
||||
if (match.Count != 0)
|
||||
return match[0].Groups["nzbTitle"].Value;
|
||||
if (match.Count != 0)
|
||||
return match[0].Groups["nzbTitle"].Value.Trim();
|
||||
}
|
||||
|
||||
return header;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue