mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-21 22:05:38 -04:00
New: Added CAPTCHA support to Rarbg.
This commit is contained in:
@@ -27,7 +27,7 @@ namespace NzbDrone.Api
|
||||
|
||||
Get["schema"] = x => GetTemplates();
|
||||
Post["test"] = x => Test(ReadResourceFromRequest(true));
|
||||
Post["connectData/{stage}"] = x => ConnectData(x.stage, ReadResourceFromRequest(true));
|
||||
Post["action/{action}"] = x => RequestAction(x.action, ReadResourceFromRequest(true));
|
||||
|
||||
GetResourceAll = GetAll;
|
||||
GetResourceById = GetProviderById;
|
||||
@@ -183,13 +183,13 @@ namespace NzbDrone.Api
|
||||
}
|
||||
|
||||
|
||||
private Response ConnectData(string stage, TProviderResource providerResource)
|
||||
private Response RequestAction(string action, TProviderResource providerResource)
|
||||
{
|
||||
var providerDefinition = GetDefinition(providerResource, true, false);
|
||||
|
||||
if (!providerDefinition.Enable) return "{}";
|
||||
var query = ((IDictionary<string, object>)Request.Query.ToDictionary()).ToDictionary(k => k.Key, k => k.Value.ToString());
|
||||
|
||||
object data = _providerFactory.ConnectData(providerDefinition, stage, (IDictionary<string, object>) Request.Query.ToDictionary());
|
||||
var data = _providerFactory.RequestAction(providerDefinition, action, query);
|
||||
Response resp = JsonConvert.SerializeObject(data);
|
||||
resp.ContentType = "application/json";
|
||||
return resp;
|
||||
|
||||
Reference in New Issue
Block a user