Fixed: (Indexers) Don't fetch releases when using unsupported capabilities

This commit is contained in:
Bogdan
2023-08-05 16:33:36 +03:00
parent 6f09b0f4f5
commit 5f643b2ced
3 changed files with 63 additions and 12 deletions
@@ -128,19 +128,12 @@ namespace NzbDrone.Core.IndexerSearch
private TSpec Get<TSpec>(NewznabRequest query, List<int> indexerIds, bool interactiveSearch)
where TSpec : SearchCriteriaBase, new()
{
var spec = new TSpec()
var spec = new TSpec
{
InteractiveSearch = interactiveSearch
};
if (query.cat != null)
{
spec.Categories = query.cat.Split(',').Where(s => !string.IsNullOrWhiteSpace(s)).Select(s => int.Parse(s)).ToArray();
}
else
{
spec.Categories = Array.Empty<int>();
}
spec.Categories = query.cat != null ? query.cat.Split(',').Where(s => !string.IsNullOrWhiteSpace(s)).Select(int.Parse).ToArray() : Array.Empty<int>();
spec.SearchTerm = query.q?.Trim();
spec.SearchType = query.t;