mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 13:23:20 -07:00
Added first implimentation of the Notification Service #8
Added tests to cover the notification service
This commit is contained in:
parent
aa5304b8dd
commit
b9a886d5dc
13 changed files with 410 additions and 10 deletions
|
@ -44,6 +44,7 @@ using PlexRequests.Core.SettingModels;
|
|||
using PlexRequests.Helpers;
|
||||
using PlexRequests.Services;
|
||||
using PlexRequests.Services.Interfaces;
|
||||
using PlexRequests.Services.Notification;
|
||||
using PlexRequests.Store;
|
||||
using PlexRequests.Store.Repository;
|
||||
using PlexRequests.UI.Jobs;
|
||||
|
@ -86,19 +87,20 @@ namespace PlexRequests.UI
|
|||
|
||||
|
||||
container.Register<IPlexApi, PlexApi>();
|
||||
|
||||
SubscribeAllObservers(container);
|
||||
base.ConfigureRequestContainer(container, context);
|
||||
}
|
||||
|
||||
protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines)
|
||||
{
|
||||
TaskManager.TaskFactory = new Jobs.PlexTaskFactory();
|
||||
TaskManager.TaskFactory = new PlexTaskFactory();
|
||||
TaskManager.Initialize(new PlexRegistry());
|
||||
|
||||
CookieBasedSessions.Enable(pipelines, CryptographyConfiguration.Default);
|
||||
|
||||
StaticConfiguration.DisableErrorTraces = false;
|
||||
|
||||
|
||||
base.ApplicationStartup(container, pipelines);
|
||||
|
||||
// Enable forms auth
|
||||
|
@ -109,8 +111,20 @@ namespace PlexRequests.UI
|
|||
};
|
||||
|
||||
FormsAuthentication.Enable(pipelines, formsAuthConfiguration);
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected override DiagnosticsConfiguration DiagnosticsConfiguration => new DiagnosticsConfiguration { Password = @"password" };
|
||||
|
||||
private void SubscribeAllObservers(TinyIoCContainer container)
|
||||
{
|
||||
var emailSettingsService = container.Resolve<ISettingsService<EmailNotificationSettings>>();
|
||||
var emailSettings = emailSettingsService.GetSettings();
|
||||
if (emailSettings.Enabled)
|
||||
{
|
||||
NotificationService.Subscribe(new EmailMessageNotification(emailSettingsService));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue