Switched over to the new service

This commit is contained in:
tidusjar 2016-03-18 11:06:27 +00:00
parent f5cb4d6879
commit 5f26aecb98
8 changed files with 30 additions and 28 deletions

View file

@ -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." });