mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-20 21:54:25 -04:00
New: Newznab/Torznab categories dropdown with indexer provided category names
Signed-off-by: Robin Dadswell <robin@dadswell.email>
This commit is contained in:
@@ -138,5 +138,31 @@ namespace NzbDrone.Core.Indexers.Newznab
|
||||
return new ValidationFailure(string.Empty, "Unable to connect to indexer, check the log for more details");
|
||||
}
|
||||
}
|
||||
|
||||
public override object RequestAction(string action, IDictionary<string, string> query)
|
||||
{
|
||||
if (action == "newznabCategories")
|
||||
{
|
||||
List<NewznabCategory> categories = null;
|
||||
try
|
||||
{
|
||||
if (Settings.BaseUrl.IsNotNullOrWhiteSpace() && Settings.ApiPath.IsNotNullOrWhiteSpace())
|
||||
{
|
||||
categories = _capabilitiesProvider.GetCapabilities(Settings).Categories;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Use default categories
|
||||
}
|
||||
|
||||
return new
|
||||
{
|
||||
options = NewznabCategoryFieldOptionsConverter.GetFieldSelectOptions(categories)
|
||||
};
|
||||
}
|
||||
|
||||
return base.RequestAction(action, query);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user