1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

Added advanced torznab option to disable rageid lookups for trackers only supporting title queries.

This commit is contained in:
Taloth Saldono 2015-05-18 20:25:29 +02:00
parent 7c246abc88
commit e5278a0243
2 changed files with 13 additions and 9 deletions

View File

@ -33,7 +33,7 @@ public virtual IList<IEnumerable<IndexerRequest>> GetSearchRequests(SingleEpisod
{
var pageableRequests = new List<IEnumerable<IndexerRequest>>();
if (searchCriteria.Series.TvRageId > 0)
if (searchCriteria.Series.TvRageId > 0 && Settings.EnableRageIDLookup)
{
pageableRequests.AddIfNotNull(GetPagedRequests(MaxPages, Settings.Categories, "tvsearch",
String.Format("&rid={0}&season={1}&ep={2}",
@ -60,7 +60,7 @@ public virtual IList<IEnumerable<IndexerRequest>> GetSearchRequests(SeasonSearch
{
var pageableRequests = new List<IEnumerable<IndexerRequest>>();
if (searchCriteria.Series.TvRageId > 0)
if (searchCriteria.Series.TvRageId > 0 && Settings.EnableRageIDLookup)
{
pageableRequests.AddIfNotNull(GetPagedRequests(MaxPages, Settings.Categories, "tvsearch",
String.Format("&rid={0}&season={1}",
@ -85,7 +85,7 @@ public virtual IList<IEnumerable<IndexerRequest>> GetSearchRequests(DailyEpisode
{
var pageableRequests = new List<IEnumerable<IndexerRequest>>();
if (searchCriteria.Series.TvRageId > 0)
if (searchCriteria.Series.TvRageId > 0 && Settings.EnableRageIDLookup)
{
pageableRequests.AddIfNotNull(GetPagedRequests(MaxPages, Settings.Categories, "tvsearch",
String.Format("&rid={0}&season={1:yyyy}&ep={1:MM}/{1:dd}",

View File

@ -49,23 +49,27 @@ public class TorznabSettings : IProviderConfig
public TorznabSettings()
{
Categories = new[] { 5030, 5040 };
AnimeCategories = Enumerable.Empty<Int32>();
AnimeCategories = Enumerable.Empty<int>();
EnableRageIDLookup = true;
}
[FieldDefinition(0, Label = "URL")]
public String Url { get; set; }
public string Url { get; set; }
[FieldDefinition(1, Label = "API Key")]
public String ApiKey { get; set; }
public string ApiKey { get; set; }
[FieldDefinition(2, Label = "Categories", HelpText = "Comma Separated list, leave blank to disable standard/daily shows", Advanced = true)]
public IEnumerable<Int32> Categories { get; set; }
public IEnumerable<int> Categories { get; set; }
[FieldDefinition(3, Label = "Anime Categories", HelpText = "Comma Separated list, leave blank to disable anime", Advanced = true)]
public IEnumerable<Int32> AnimeCategories { get; set; }
public IEnumerable<int> AnimeCategories { get; set; }
[FieldDefinition(4, Label = "Additional Parameters", HelpText = "Additional Torznab parameters", Advanced = true)]
public String AdditionalParameters { get; set; }
public string AdditionalParameters { get; set; }
[FieldDefinition(5, Label = "Enable RageID Lookup", HelpText = "Disable this if your tracker doesn't have tvrage ids, Sonarr will then use (more expensive) title queries.", Advanced = true)]
public bool EnableRageIDLookup { get; set; }
public NzbDroneValidationResult Validate()
{