mirror of
https://github.com/Lidarr/Lidarr.git
synced 2026-02-11 16:29:21 -06:00
Fixed: Avoid requests without categories for FileList
(cherry picked from commit 4728fa29ef578a7ff33cf16a4e6b46689c4be1b4)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Common.Http;
|
||||
using NzbDrone.Core.IndexerSearch.Definitions;
|
||||
|
||||
@@ -44,6 +45,11 @@ namespace NzbDrone.Core.Indexers.FileList
|
||||
|
||||
private IEnumerable<IndexerRequest> GetRequest(string searchType, IEnumerable<int> categories, string parameters)
|
||||
{
|
||||
if (categories.Empty())
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
||||
var categoriesQuery = string.Join(",", categories.Distinct());
|
||||
|
||||
var baseUrl = string.Format("{0}/api.php?action={1}&category={2}{3}", Settings.BaseUrl.TrimEnd('/'), searchType, categoriesQuery, parameters);
|
||||
|
||||
@@ -13,6 +13,8 @@ namespace NzbDrone.Core.Indexers.FileList
|
||||
RuleFor(c => c.Username).NotEmpty();
|
||||
RuleFor(c => c.Passkey).NotEmpty();
|
||||
|
||||
RuleFor(c => c.Categories).NotEmpty();
|
||||
|
||||
RuleFor(c => c.SeedCriteria).SetValidator(_ => new SeedCriteriaSettingsValidator());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user