mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-07 13:41:13 -07:00
Added the option to set a CP quality #38
This commit is contained in:
parent
4136116555
commit
e34170f55a
9 changed files with 166 additions and 9 deletions
|
@ -59,6 +59,7 @@ namespace PlexRequests.UI.Modules
|
|||
private IPlexApi PlexApi { get; }
|
||||
private ISonarrApi SonarrApi { get; }
|
||||
private PushbulletApi PushbulletApi { get; }
|
||||
private ICouchPotatoApi CpApi { get; }
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
public AdminModule(ISettingsService<PlexRequestSettings> rpService,
|
||||
|
@ -70,7 +71,8 @@ namespace PlexRequests.UI.Modules
|
|||
ISettingsService<EmailNotificationSettings> email,
|
||||
IPlexApi plexApi,
|
||||
ISettingsService<PushbulletNotificationSettings> pbSettings,
|
||||
PushbulletApi pbApi) : base("admin")
|
||||
PushbulletApi pbApi,
|
||||
ICouchPotatoApi cpApi) : base("admin")
|
||||
{
|
||||
RpService = rpService;
|
||||
CpService = cpService;
|
||||
|
@ -82,6 +84,7 @@ namespace PlexRequests.UI.Modules
|
|||
PlexApi = plexApi;
|
||||
PushbulletService = pbSettings;
|
||||
PushbulletApi = pbApi;
|
||||
CpApi = cpApi;
|
||||
|
||||
#if !DEBUG
|
||||
this.RequiresAuthentication();
|
||||
|
@ -107,6 +110,7 @@ namespace PlexRequests.UI.Modules
|
|||
Post["/sonarr"] = _ => SaveSonarr();
|
||||
|
||||
Post["/sonarrprofiles"] = _ => GetSonarrQualityProfiles();
|
||||
Post["/cpprofiles"] = _ => GetCpProfiles();
|
||||
|
||||
Get["/emailnotification"] = _ => EmailNotifications();
|
||||
Post["/emailnotification"] = _ => SaveEmailNotifications();
|
||||
|
@ -354,5 +358,13 @@ namespace PlexRequests.UI.Modules
|
|||
? new JsonResponseModel { Result = true, Message = "Successfully Updated the Settings for Pushbullet Notifications!" }
|
||||
: new JsonResponseModel { Result = false, Message = "Could not update the settings, take a look at the logs." });
|
||||
}
|
||||
|
||||
private Response GetCpProfiles()
|
||||
{
|
||||
var settings = this.Bind<CouchPotatoSettings>();
|
||||
var profiles = CpApi.GetProfiles(settings.FullUri, settings.ApiKey);
|
||||
|
||||
return Response.AsJson(profiles);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue