mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-12 08:16:05 -07:00
parent
206fd74d7f
commit
da8b6340ae
2 changed files with 17 additions and 7 deletions
|
@ -62,12 +62,9 @@ namespace PlexRequests.Services.Notification
|
|||
|
||||
public static void Subscribe(INotification notification)
|
||||
{
|
||||
Log.Trace("Subscribing Observer {0}", notification.NotificationName);
|
||||
INotification notificationValue;
|
||||
if (Observers.TryGetValue(notification.NotificationName, out notificationValue))
|
||||
{
|
||||
Log.Trace("Observer {0} already exists", notification.NotificationName);
|
||||
// Observer already exists
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -357,7 +357,14 @@ namespace PlexRequests.UI.Modules
|
|||
|
||||
var result = EmailService.SaveSettings(settings);
|
||||
|
||||
if (settings.Enabled)
|
||||
{
|
||||
NotificationService.Subscribe(new EmailMessageNotification(EmailService));
|
||||
}
|
||||
else
|
||||
{
|
||||
NotificationService.UnSubscribe(new EmailMessageNotification(EmailService));
|
||||
}
|
||||
|
||||
Log.Info("Saved email settings, result: {0}", result);
|
||||
return Response.AsJson(result
|
||||
|
@ -389,8 +396,14 @@ namespace PlexRequests.UI.Modules
|
|||
Log.Trace(settings.DumpJson());
|
||||
|
||||
var result = PushbulletService.SaveSettings(settings);
|
||||
|
||||
if (settings.Enabled)
|
||||
{
|
||||
NotificationService.Subscribe(new PushbulletNotification(PushbulletApi, PushbulletService));
|
||||
}
|
||||
else
|
||||
{
|
||||
NotificationService.UnSubscribe(new PushbulletNotification(PushbulletApi, PushbulletService));
|
||||
}
|
||||
|
||||
Log.Info("Saved email settings, result: {0}", result);
|
||||
return Response.AsJson(result
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue