mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 21:03:17 -07:00
Merge branch 'dev' of https://github.com/tidusjar/Ombi into dev
This commit is contained in:
commit
2465124b4c
13 changed files with 113 additions and 22 deletions
|
@ -156,7 +156,7 @@ namespace Ombi.UI.Modules.Admin
|
|||
var cp = await CpSettings.GetSettingsAsync();
|
||||
if (cp.Enabled)
|
||||
{
|
||||
return Response.AsJson(new JsonResponseModel { Result = false, Message = "CouchPotato is enabled, we cannot enable Watcher and CouchPotato" });
|
||||
return Response.AsJson(new JsonResponseModel { Result = false, Message = "CouchPotato is enabled, we cannot enable Radarr and CouchPotato" });
|
||||
}
|
||||
|
||||
var valid = this.Validate(radarrSettings);
|
||||
|
|
|
@ -66,8 +66,10 @@ namespace Ombi.UI.Modules
|
|||
ICacheProvider cache,
|
||||
IAnalytics an,
|
||||
IPlexNotificationEngine engine,
|
||||
IEmbyNotificationEngine embyEngine,
|
||||
ISecurityExtensions security,
|
||||
ISettingsService<CustomizationSettings> customSettings) : base("requests", prSettings, security)
|
||||
ISettingsService<CustomizationSettings> customSettings,
|
||||
ISettingsService<EmbySettings> embyS) : base("requests", prSettings, security)
|
||||
{
|
||||
Service = service;
|
||||
PrSettings = prSettings;
|
||||
|
@ -81,8 +83,10 @@ namespace Ombi.UI.Modules
|
|||
CpApi = cpApi;
|
||||
Cache = cache;
|
||||
Analytics = an;
|
||||
NotificationEngine = engine;
|
||||
PlexNotificationEngine = engine;
|
||||
EmbyNotificationEngine = embyEngine;
|
||||
CustomizationSettings = customSettings;
|
||||
EmbySettings = embyS;
|
||||
|
||||
Get["/", true] = async (x, ct) => await LoadRequests();
|
||||
Get["/movies", true] = async (x, ct) => await GetMovies();
|
||||
|
@ -111,11 +115,13 @@ namespace Ombi.UI.Modules
|
|||
private ISettingsService<SickRageSettings> SickRageSettings { get; }
|
||||
private ISettingsService<CouchPotatoSettings> CpSettings { get; }
|
||||
private ISettingsService<CustomizationSettings> CustomizationSettings { get; }
|
||||
private ISettingsService<EmbySettings> EmbySettings { get; }
|
||||
private ISonarrApi SonarrApi { get; }
|
||||
private ISickRageApi SickRageApi { get; }
|
||||
private ICouchPotatoApi CpApi { get; }
|
||||
private ICacheProvider Cache { get; }
|
||||
private INotificationEngine NotificationEngine { get; }
|
||||
private INotificationEngine PlexNotificationEngine { get; }
|
||||
private INotificationEngine EmbyNotificationEngine { get; }
|
||||
|
||||
private async Task<Negotiator> LoadRequests()
|
||||
{
|
||||
|
@ -438,7 +444,21 @@ namespace Ombi.UI.Modules
|
|||
originalRequest.Available = available;
|
||||
|
||||
var result = await Service.UpdateRequestAsync(originalRequest);
|
||||
await NotificationEngine.NotifyUsers(originalRequest, available ? NotificationType.RequestAvailable : NotificationType.RequestDeclined);
|
||||
|
||||
var plexSettings = await PlexSettings.GetSettingsAsync();
|
||||
if (plexSettings.Enable)
|
||||
{
|
||||
await
|
||||
PlexNotificationEngine.NotifyUsers(originalRequest,
|
||||
available ? NotificationType.RequestAvailable : NotificationType.RequestDeclined);
|
||||
}
|
||||
|
||||
var embySettings = await EmbySettings.GetSettingsAsync();
|
||||
if (embySettings.Enable)
|
||||
{
|
||||
await EmbyNotificationEngine.NotifyUsers(originalRequest,
|
||||
available ? NotificationType.RequestAvailable : NotificationType.RequestDeclined);
|
||||
}
|
||||
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" });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue