Fixed: Avoid requests without categories for FileList

(cherry picked from commit 4728fa29ef578a7ff33cf16a4e6b46689c4be1b4)
This commit is contained in:
Bogdan 2025-03-30 15:26:18 +03:00
parent 72fa05cf41
commit 66ea1b1dfb
2 changed files with 8 additions and 0 deletions

View file

@ -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);

View file

@ -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());
}
}