mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-21 05:43:19 -07:00
few small changes, added plex settings
This commit is contained in:
parent
f2399d6407
commit
b9dd08a8bc
8 changed files with 146 additions and 13 deletions
|
@ -48,13 +48,16 @@ namespace PlexRequests.UI.Modules
|
|||
private ISettingsService<PlexRequestSettings> RpService { get; set; }
|
||||
private ISettingsService<CouchPotatoSettings> CpService { get; set; }
|
||||
private ISettingsService<AuthenticationSettings> AuthService { get; set; }
|
||||
private ISettingsService<PlexSettings> PlexService { get; set; }
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
public AdminModule(ISettingsService<PlexRequestSettings> rpService, ISettingsService<CouchPotatoSettings> cpService, ISettingsService<AuthenticationSettings> auth) : base("admin")
|
||||
public AdminModule(ISettingsService<PlexRequestSettings> rpService, ISettingsService<CouchPotatoSettings> cpService, ISettingsService<AuthenticationSettings> auth, ISettingsService<PlexSettings> plex) : base("admin")
|
||||
{
|
||||
RpService = rpService;
|
||||
CpService = cpService;
|
||||
AuthService = auth;
|
||||
PlexService = plex;
|
||||
|
||||
#if !DEBUG
|
||||
this.RequiresAuthentication();
|
||||
#endif
|
||||
|
@ -71,6 +74,9 @@ namespace PlexRequests.UI.Modules
|
|||
|
||||
Get["/couchpotato"] = _ => CouchPotato();
|
||||
Post["/couchpotato"] = _ => SaveCouchPotato();
|
||||
|
||||
Get["/plex"] = _ => Plex();
|
||||
Post["/plex"] = _ => SavePlex();
|
||||
}
|
||||
|
||||
private Negotiator Authentication()
|
||||
|
@ -180,5 +186,20 @@ namespace PlexRequests.UI.Modules
|
|||
return Context.GetRedirect("~/admin/couchpotato");
|
||||
}
|
||||
|
||||
private Negotiator Plex()
|
||||
{
|
||||
var settings = PlexService.GetSettings();
|
||||
|
||||
return View["Plex", settings];
|
||||
}
|
||||
|
||||
private Response SavePlex()
|
||||
{
|
||||
var plexSettings = this.Bind<PlexSettings>();
|
||||
PlexService.SaveSettings(plexSettings);
|
||||
|
||||
return Context.GetRedirect("~/admin/plex");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue