Fixed: Return all movie categories for RARBG

Co-Authored-By: FuNK3Y <funk3y@users.noreply.github.com>
pull/3606/head
Qstick 5 years ago
parent d86c811543
commit ed0e69de53

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Http;
using NzbDrone.Core.IndexerSearch.Definitions;
@ -60,7 +61,9 @@ namespace NzbDrone.Core.Indexers.Rarbg
requestBuilder.AddQueryParam("ranked", "0");
}
requestBuilder.AddQueryParam("category", "movies");
var categoryParam = string.Join(";", Settings.Categories.Distinct());
requestBuilder.AddQueryParam("category", categoryParam);
requestBuilder.AddQueryParam("limit", "100");
requestBuilder.AddQueryParam("token", _tokenProvider.GetToken(Settings));
requestBuilder.AddQueryParam("format", "json_extended");
@ -98,7 +101,9 @@ namespace NzbDrone.Core.Indexers.Rarbg
requestBuilder.AddQueryParam("ranked", "0");
}
requestBuilder.AddQueryParam("category", "movies");
var categoryParam = string.Join(";", Settings.Categories.Distinct());
requestBuilder.AddQueryParam("category", categoryParam);
requestBuilder.AddQueryParam("limit", "100");
requestBuilder.AddQueryParam("token", _tokenProvider.GetToken(Settings));
requestBuilder.AddQueryParam("format", "json_extended");

@ -14,6 +14,8 @@ namespace NzbDrone.Core.Indexers.Rarbg
{
RuleFor(c => c.BaseUrl).ValidRootUrl();
RuleFor(c => c.Categories).NotEmpty();
RuleFor(c => c.SeedCriteria).SetValidator(_ => new SeedCriteriaSettingsValidator());
}
}
@ -27,6 +29,7 @@ namespace NzbDrone.Core.Indexers.Rarbg
BaseUrl = "https://torrentapi.org";
RankedOnly = false;
MinimumSeeders = IndexerDefaults.MINIMUM_SEEDERS;
Categories = new[] { 14, 48, 17, 44, 45, 47, 50, 51, 52, 42, 46 };
MultiLanguages = Enumerable.Empty<int>();
}
@ -48,7 +51,10 @@ namespace NzbDrone.Core.Indexers.Rarbg
[FieldDefinition(5, Type = FieldType.Tag, SelectOptions = typeof(IndexerFlags), Label = "Required Flags", HelpText = "What indexer flags are required?", HelpLink = "https://github.com/Radarr/Radarr/wiki/Indexer-Flags#1-required-flags", Advanced = true)]
public IEnumerable<int> RequiredFlags { get; set; }
[FieldDefinition(6)]
[FieldDefinition(6, Type = FieldType.Textbox, Label = "Categories", HelpText = "Comma Separated list, you can retrieve the ID by checking the URL behind the category on the website (i.e. Movie/x264/1080 = 44)", HelpLink = "https://rarbgmirror.org/torrents.php?category=movies", Advanced = true)]
public IEnumerable<int> Categories { get; set; }
[FieldDefinition(7)]
public SeedCriteriaSettings SeedCriteria { get; } = new SeedCriteriaSettings();
public NzbDroneValidationResult Validate()

Loading…
Cancel
Save