mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-08 06:00:50 -07:00
Making the configuration actually do something. Setting a default configuration if there is no DB
This commit is contained in:
parent
c49e9a386b
commit
f2399d6407
10 changed files with 171 additions and 75 deletions
|
@ -30,7 +30,8 @@ using Humanizer;
|
|||
|
||||
using Nancy;
|
||||
using Nancy.Responses.Negotiation;
|
||||
|
||||
using PlexRequests.Core;
|
||||
using PlexRequests.Core.SettingModels;
|
||||
using PlexRequests.Store;
|
||||
using PlexRequests.UI.Models;
|
||||
|
||||
|
@ -38,10 +39,11 @@ namespace PlexRequests.UI.Modules
|
|||
{
|
||||
public class RequestsModule : BaseModule
|
||||
{
|
||||
private IRepository<RequestedModel> Service { get; set; }
|
||||
public RequestsModule(IRepository<RequestedModel> service) : base("requests")
|
||||
|
||||
public RequestsModule(IRepository<RequestedModel> service, ISettingsService<PlexRequestSettings> prSettings) : base("requests")
|
||||
{
|
||||
Service = service;
|
||||
PrSettings = prSettings;
|
||||
|
||||
Get["/"] = _ => LoadRequests();
|
||||
Get["/movies"] = _ => GetMovies();
|
||||
|
@ -52,11 +54,13 @@ namespace PlexRequests.UI.Modules
|
|||
return DeleteRequest((int)Request.Form.id, convertedType);
|
||||
};
|
||||
}
|
||||
|
||||
private IRepository<RequestedModel> Service { get; }
|
||||
private ISettingsService<PlexRequestSettings> PrSettings { get; }
|
||||
|
||||
private Negotiator LoadRequests()
|
||||
{
|
||||
return View["Requests/Index"];
|
||||
var settings = PrSettings.GetSettings();
|
||||
return View["Requests/Index", settings];
|
||||
}
|
||||
|
||||
private Response GetMovies()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue