mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-26 22:46:53 -04:00
New: Release Group can now be used in rename patterns
This commit is contained in:
@@ -70,7 +70,6 @@ namespace NzbDrone.Core.Indexers
|
||||
|
||||
reportInfo.Title = title;
|
||||
reportInfo.PublishDate = item.PublishDate();
|
||||
reportInfo.ReleaseGroup = ParseReleaseGroup(title);
|
||||
reportInfo.DownloadUrl = GetNzbUrl(item);
|
||||
reportInfo.InfoUrl = GetNzbInfoUrl(item);
|
||||
|
||||
@@ -114,25 +113,6 @@ namespace NzbDrone.Core.Indexers
|
||||
return currentResult;
|
||||
}
|
||||
|
||||
public static string ParseReleaseGroup(string title)
|
||||
{
|
||||
title = title.Trim();
|
||||
var index = title.LastIndexOf('-');
|
||||
|
||||
if (index < 0)
|
||||
index = title.LastIndexOf(' ');
|
||||
|
||||
if (index < 0)
|
||||
return String.Empty;
|
||||
|
||||
var group = title.Substring(index + 1);
|
||||
|
||||
if (@group.Length == title.Length)
|
||||
return String.Empty;
|
||||
|
||||
return @group.Trim('-', ' ', '[', ']');
|
||||
}
|
||||
|
||||
private static readonly Regex ReportSizeRegex = new Regex(@"(?<value>\d+\.\d{1,2}|\d+\,\d+\.\d{1,2}|\d+)\W?(?<unit>GB|MB|GiB|MiB)",
|
||||
RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user