mirror of
https://github.com/Radarr/Radarr
synced 2026-01-08 16:44:16 +01:00
Fixed: Avoid requests without categories for FileList
This commit is contained in:
parent
107f843303
commit
bc08b0b2e1
2 changed files with 13 additions and 1 deletions
|
|
@ -42,6 +42,11 @@ public virtual IndexerPageableRequestChain GetSearchRequests(MovieSearchCriteria
|
|||
|
||||
private IEnumerable<IndexerRequest> GetRequest(string searchType, string parameters)
|
||||
{
|
||||
if (Settings.Categories.Empty())
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
var categoriesQuery = string.Join(",", Settings.Categories.Distinct());
|
||||
|
||||
var baseUrl = $"{Settings.BaseUrl.TrimEnd('/')}/api.php?action={searchType}&category={categoriesQuery}{parameters}";
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ public FileListSettingsValidator()
|
|||
RuleFor(c => c.Username).NotEmpty();
|
||||
RuleFor(c => c.Passkey).NotEmpty();
|
||||
|
||||
RuleFor(c => c.Categories).NotEmpty();
|
||||
|
||||
RuleFor(c => c.SeedCriteria).SetValidator(_ => new SeedCriteriaSettingsValidator());
|
||||
}
|
||||
}
|
||||
|
|
@ -32,8 +34,9 @@ public FileListSettings()
|
|||
|
||||
Categories = new[]
|
||||
{
|
||||
(int)FileListCategories.Movie_HD,
|
||||
(int)FileListCategories.Movie_SD,
|
||||
(int)FileListCategories.Movie_HD,
|
||||
(int)FileListCategories.Movie_HDRO,
|
||||
(int)FileListCategories.Movie_4K
|
||||
};
|
||||
|
||||
|
|
@ -80,6 +83,10 @@ public NzbDroneValidationResult Validate()
|
|||
|
||||
public enum FileListCategories
|
||||
{
|
||||
[FieldOption(Label = "Anime")]
|
||||
Anime = 24,
|
||||
[FieldOption(Label = "Animation")]
|
||||
Animation = 15,
|
||||
[FieldOption("Movies SD")]
|
||||
Movie_SD = 1,
|
||||
[FieldOption("Movies DVD")]
|
||||
|
|
|
|||
Loading…
Reference in a new issue