mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-19 22:04:56 -04:00
Cleanup SearchCriteria, Pass Cats from Search to Indexers
This commit is contained in:
@@ -82,15 +82,10 @@ namespace NzbDrone.Core.Indexers.Newznab
|
||||
};
|
||||
}
|
||||
|
||||
private NewznabSettings GetSettings(string url, string apiPath = null, int[] categories = null)
|
||||
private NewznabSettings GetSettings(string url, string apiPath = null)
|
||||
{
|
||||
var settings = new NewznabSettings { BaseUrl = url };
|
||||
|
||||
if (categories != null)
|
||||
{
|
||||
settings.Categories = categories;
|
||||
}
|
||||
|
||||
if (apiPath.IsNotNullOrWhiteSpace())
|
||||
{
|
||||
settings.ApiPath = apiPath;
|
||||
@@ -123,17 +118,6 @@ namespace NzbDrone.Core.Indexers.Newznab
|
||||
{
|
||||
var capabilities = _capabilitiesProvider.GetCapabilities(Settings);
|
||||
|
||||
var notSupported = Settings.Categories.Except(CategoryIds(capabilities.Categories));
|
||||
|
||||
if (notSupported.Any())
|
||||
{
|
||||
_logger.Warn($"{Definition.Name} does not support the following categories: {string.Join(", ", notSupported)}. You should probably remove them.");
|
||||
if (notSupported.Count() == Settings.Categories.Count())
|
||||
{
|
||||
return new ValidationFailure(string.Empty, $"This indexer does not support any of the selected categories! (You may need to turn on advanced settings to see them)");
|
||||
}
|
||||
}
|
||||
|
||||
if (capabilities.SearchParams != null && capabilities.SearchParams.Contains(SearchParam.Q))
|
||||
{
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user