mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 21:03:17 -07:00
Switched over to the new service
This commit is contained in:
parent
f5cb4d6879
commit
5f26aecb98
8 changed files with 30 additions and 28 deletions
|
@ -44,7 +44,7 @@ namespace PlexRequests.UI.Modules
|
|||
public class ApprovalModule : BaseModule
|
||||
{
|
||||
|
||||
public ApprovalModule(IRepository<RequestedModel> service, ISettingsService<CouchPotatoSettings> cpService, ICouchPotatoApi cpApi, ISonarrApi sonarrApi,
|
||||
public ApprovalModule(IRequestService service, ISettingsService<CouchPotatoSettings> cpService, ICouchPotatoApi cpApi, ISonarrApi sonarrApi,
|
||||
ISettingsService<SonarrSettings> sonarrSettings) : base("approval")
|
||||
{
|
||||
this.RequiresAuthentication();
|
||||
|
@ -59,12 +59,12 @@ namespace PlexRequests.UI.Modules
|
|||
Post["/approveall"] = x => ApproveAll();
|
||||
}
|
||||
|
||||
private IRepository<RequestedModel> Service { get; set; }
|
||||
private IRequestService Service { get; }
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
private ISettingsService<SonarrSettings> SonarrSettings { get; set; }
|
||||
private ISettingsService<SonarrSettings> SonarrSettings { get; }
|
||||
private ISettingsService<CouchPotatoSettings> CpService { get; }
|
||||
private ISonarrApi SonarrApi { get; set; }
|
||||
private ISonarrApi SonarrApi { get; }
|
||||
private ICouchPotatoApi CpApi { get; }
|
||||
|
||||
/// <summary>
|
||||
|
@ -135,7 +135,7 @@ namespace PlexRequests.UI.Modules
|
|||
request.Approved = true;
|
||||
|
||||
// Update the record
|
||||
var inserted = Service.Update(request);
|
||||
var inserted = Service.UpdateRequest(request);
|
||||
|
||||
return Response.AsJson(inserted
|
||||
? new JsonResponseModel {Result = true}
|
||||
|
@ -195,7 +195,7 @@ namespace PlexRequests.UI.Modules
|
|||
try
|
||||
{
|
||||
|
||||
var result = Service.UpdateAll(updatedRequests); return Response.AsJson(result
|
||||
var result = Service.BatchUpdate(updatedRequests); return Response.AsJson(result
|
||||
? new JsonResponseModel { Result = true }
|
||||
: new JsonResponseModel { Result = false, Message = "We could not approve all of the requests. Please try again or check the logs." });
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ namespace PlexRequests.UI.Modules
|
|||
public class RequestsModule : BaseModule
|
||||
{
|
||||
|
||||
public RequestsModule(IRepository<RequestedModel> service, ISettingsService<PlexRequestSettings> prSettings, ISettingsService<PlexSettings> plex) : base("requests")
|
||||
public RequestsModule(IRequestService service, ISettingsService<PlexRequestSettings> prSettings, ISettingsService<PlexSettings> plex) : base("requests")
|
||||
{
|
||||
Service = service;
|
||||
PrSettings = prSettings;
|
||||
|
@ -64,7 +64,7 @@ namespace PlexRequests.UI.Modules
|
|||
Post["/addnote"] = _ => AddNote((int)Request.Form.requestId, (string)Request.Form.noteArea);
|
||||
}
|
||||
|
||||
private IRepository<RequestedModel> Service { get; }
|
||||
private IRequestService Service { get; }
|
||||
private ISettingsService<PlexRequestSettings> PrSettings { get; }
|
||||
private ISettingsService<PlexSettings> PlexSettings { get; }
|
||||
|
||||
|
@ -140,7 +140,7 @@ namespace PlexRequests.UI.Modules
|
|||
}
|
||||
|
||||
var currentEntity = Service.Get(requestid);
|
||||
Service.Delete(currentEntity);
|
||||
Service.DeleteRequest(currentEntity);
|
||||
return Response.AsJson(new JsonResponseModel { Result = true });
|
||||
}
|
||||
|
||||
|
@ -165,7 +165,7 @@ namespace PlexRequests.UI.Modules
|
|||
: string.Empty;
|
||||
|
||||
|
||||
var result = Service.Update(originalRequest);
|
||||
var result = Service.UpdateRequest(originalRequest);
|
||||
return Response.AsJson(result
|
||||
? new JsonResponseModel { Result = true }
|
||||
: new JsonResponseModel { Result = false, Message = "Could not add issue, please try again or contact the administrator!" });
|
||||
|
@ -186,7 +186,7 @@ namespace PlexRequests.UI.Modules
|
|||
originalRequest.Issues = IssueState.None;
|
||||
originalRequest.OtherMessage = string.Empty;
|
||||
|
||||
var result = Service.Update(originalRequest);
|
||||
var result = Service.UpdateRequest(originalRequest);
|
||||
return Response.AsJson(result
|
||||
? new JsonResponseModel { Result = true }
|
||||
: new JsonResponseModel { Result = false, Message = "Could not clear issue, please try again or check the logs" });
|
||||
|
@ -202,7 +202,7 @@ namespace PlexRequests.UI.Modules
|
|||
|
||||
originalRequest.Available = available;
|
||||
|
||||
var result = Service.Update(originalRequest);
|
||||
var result = Service.UpdateRequest(originalRequest);
|
||||
return Response.AsJson(result
|
||||
? new { Result = true, Available = available, Message = string.Empty }
|
||||
: new { Result = false, Available = false, Message = "Could not update the availability, please try again or check the logs" });
|
||||
|
@ -218,7 +218,7 @@ namespace PlexRequests.UI.Modules
|
|||
|
||||
originalRequest.AdminNote = noteArea;
|
||||
|
||||
var result = Service.Update(originalRequest);
|
||||
var result = Service.UpdateRequest(originalRequest);
|
||||
return Response.AsJson(result
|
||||
? new JsonResponseModel { Result = true }
|
||||
: new JsonResponseModel { Result = false, Message = "Could not update the notes, please try again or check the logs" });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue