1
0
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:
Mark McDowall
2013-12-08 22:25:11 -08:00
parent 9dcdd06b6c
commit f76c4700a6
17 changed files with 92 additions and 40 deletions
@@ -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);