mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-11 07:46:05 -07:00
Added code to request the api key for CouchPotato
This commit is contained in:
parent
f9af1dc12b
commit
ae64c11485
10 changed files with 670 additions and 484 deletions
|
@ -171,6 +171,7 @@ namespace PlexRequests.UI.Modules
|
|||
|
||||
Post["/sonarrprofiles"] = _ => GetSonarrQualityProfiles();
|
||||
Post["/cpprofiles", true] = async (x,ct) => await GetCpProfiles();
|
||||
Post["/cpapikey", true] = async (x,ct) => await GetCpApiKey();
|
||||
|
||||
Get["/emailnotification"] = _ => EmailNotifications();
|
||||
Post["/emailnotification"] = _ => SaveEmailNotifications();
|
||||
|
@ -696,6 +697,20 @@ namespace PlexRequests.UI.Modules
|
|||
return Response.AsJson(profiles);
|
||||
}
|
||||
|
||||
private async Task<Response> GetCpApiKey()
|
||||
{
|
||||
var settings = this.Bind<CouchPotatoSettings>();
|
||||
|
||||
if (string.IsNullOrEmpty(settings.Username) || string.IsNullOrEmpty(settings.Password))
|
||||
{
|
||||
return Response.AsJson(new { Message = "Please enter a username and password to request the Api Key", Result = false });
|
||||
}
|
||||
var key = CpApi.GetApiKey(settings.FullUri, settings.Username, settings.Password);
|
||||
|
||||
|
||||
return Response.AsJson(key);
|
||||
}
|
||||
|
||||
private Negotiator Logs()
|
||||
{
|
||||
return View["Logs"];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue