public PushoverNotification(IPushoverApi api, ISettingsService <PushoverSettings> sn, ILogger <PushoverNotification> log, INotificationTemplatesRepository r, IMovieRequestRepository m, ITvRequestRepository t,
                             ISettingsService <CustomizationSettings> s, IRepository <RequestSubscription> sub, IMusicRequestRepository music,
                             IRepository <UserNotificationPreferences> userPref, UserManager <OmbiUser> um) : base(sn, r, m, t, s, log, sub, music, userPref, um)
 {
     Api    = api;
     Logger = log;
 }
        public AdminModule(ISettingsService <PlexRequestSettings> prService,
                           ISettingsService <CouchPotatoSettings> cpService,
                           ISettingsService <AuthenticationSettings> auth,
                           ISettingsService <PlexSettings> plex,
                           ISettingsService <SonarrSettings> sonarr,
                           ISettingsService <SickRageSettings> sickrage,
                           ISonarrApi sonarrApi,
                           ISettingsService <EmailNotificationSettings> email,
                           IPlexApi plexApi,
                           ISettingsService <PushbulletNotificationSettings> pbSettings,
                           PushbulletApi pbApi,
                           ICouchPotatoApi cpApi,
                           ISettingsService <PushoverNotificationSettings> pushoverSettings,
                           IPushoverApi pushoverApi,
                           IRepository <LogEntity> logsRepo,
                           INotificationService notify,
                           ISettingsService <HeadphonesSettings> headphones,
                           ISettingsService <LogSettings> logs,
                           ICacheProvider cache, ISettingsService <SlackNotificationSettings> slackSettings,
                           ISlackApi slackApi) : base("admin", prService)
        {
            PrService           = prService;
            CpService           = cpService;
            AuthService         = auth;
            PlexService         = plex;
            SonarrService       = sonarr;
            SonarrApi           = sonarrApi;
            EmailService        = email;
            PlexApi             = plexApi;
            PushbulletService   = pbSettings;
            PushbulletApi       = pbApi;
            CpApi               = cpApi;
            SickRageService     = sickrage;
            LogsRepo            = logsRepo;
            PushoverService     = pushoverSettings;
            PushoverApi         = pushoverApi;
            NotificationService = notify;
            HeadphonesService   = headphones;
            LogService          = logs;
            Cache               = cache;
            SlackSettings       = slackSettings;
            SlackApi            = slackApi;

            this.RequiresClaims(UserClaims.Admin);

            Get["/"] = _ => Admin();

            Get["/authentication"]  = _ => Authentication();
            Post["/authentication"] = _ => SaveAuthentication();

            Post["/"] = _ => SaveAdmin();

            Post["/requestauth"] = _ => RequestAuthToken();

            Get["/getusers"] = _ => GetUsers();

            Get["/couchpotato"]  = _ => CouchPotato();
            Post["/couchpotato"] = _ => SaveCouchPotato();

            Get["/plex"]  = _ => Plex();
            Post["/plex"] = _ => SavePlex();

            Get["/sonarr"]  = _ => Sonarr();
            Post["/sonarr"] = _ => SaveSonarr();

            Get["/sickrage"]  = _ => Sickrage();
            Post["/sickrage"] = _ => SaveSickrage();

            Post["/sonarrprofiles"] = _ => GetSonarrQualityProfiles();
            Post["/cpprofiles"]     = _ => GetCpProfiles();

            Get["/emailnotification"]      = _ => EmailNotifications();
            Post["/emailnotification"]     = _ => SaveEmailNotifications();
            Post["/testemailnotification"] = _ => TestEmailNotifications();
            Get["/status"] = _ => Status();

            Get["/pushbulletnotification"]      = _ => PushbulletNotifications();
            Post["/pushbulletnotification"]     = _ => SavePushbulletNotifications();
            Post["/testpushbulletnotification"] = _ => TestPushbulletNotifications();

            Get["/pushovernotification"]      = _ => PushoverNotifications();
            Post["/pushovernotification"]     = _ => SavePushoverNotifications();
            Post["/testpushovernotification"] = _ => TestPushoverNotifications();

            Get["/logs"]      = _ => Logs();
            Get["/loglevel"]  = _ => GetLogLevels();
            Post["/loglevel"] = _ => UpdateLogLevels(Request.Form.level);
            Get["/loadlogs"]  = _ => LoadLogs();

            Get["/headphones"]  = _ => Headphones();
            Post["/headphones"] = _ => SaveHeadphones();

            Post["/createapikey"] = x => CreateApiKey();

            Post["/autoupdate"] = x => AutoUpdate();

            Post["/testslacknotification"] = _ => TestSlackNotification();

            Get["/slacknotification"]  = _ => SlackNotifications();
            Post["/slacknotification"] = _ => SaveSlackNotifications();
        }
Exemple #3
0
 public PushoverNotification(IPushoverApi pushoverApi, ISettingsService <PushoverNotificationSettings> settings)
 {
     PushoverApi     = pushoverApi;
     SettingsService = settings;
 }
Exemple #4
0
 public PushoverNotification(IPushoverApi api, ISettingsService <PushoverSettings> sn, ILogger <PushoverNotification> log, INotificationTemplatesRepository r, IMovieRequestRepository m, ITvRequestRepository t,
                             ISettingsService <CustomizationSettings> s) : base(sn, r, m, t, s, log)
 {
     Api    = api;
     Logger = log;
 }
Exemple #5
0
        public AdminModule(ISettingsService <PlexRequestSettings> prService,
                           ISettingsService <CouchPotatoSettings> cpService,
                           ISettingsService <AuthenticationSettings> auth,
                           ISettingsService <PlexSettings> plex,
                           ISettingsService <SonarrSettings> sonarr,
                           ISettingsService <SickRageSettings> sickrage,
                           ISonarrApi sonarrApi,
                           ISettingsService <EmailNotificationSettings> email,
                           IPlexApi plexApi,
                           ISettingsService <PushbulletNotificationSettings> pbSettings,
                           PushbulletApi pbApi,
                           ICouchPotatoApi cpApi,
                           ISettingsService <PushoverNotificationSettings> pushoverSettings,
                           ISettingsService <NewletterSettings> newsletter,
                           IPushoverApi pushoverApi,
                           IRepository <LogEntity> logsRepo,
                           INotificationService notify,
                           ISettingsService <HeadphonesSettings> headphones,
                           ISettingsService <LogSettings> logs,
                           ICacheProvider cache, ISettingsService <SlackNotificationSettings> slackSettings,
                           ISlackApi slackApi, ISettingsService <LandingPageSettings> lp,
                           ISettingsService <ScheduledJobsSettings> scheduler, IJobRecord rec, IAnalytics analytics,
                           ISettingsService <NotificationSettingsV2> notifyService, IRecentlyAdded recentlyAdded,
                           ISettingsService <WatcherSettings> watcherSettings
                           , ISecurityExtensions security) : base("admin", prService, security)
        {
            PrService            = prService;
            CpService            = cpService;
            AuthService          = auth;
            PlexService          = plex;
            SonarrService        = sonarr;
            SonarrApi            = sonarrApi;
            EmailService         = email;
            PlexApi              = plexApi;
            PushbulletService    = pbSettings;
            PushbulletApi        = pbApi;
            CpApi                = cpApi;
            SickRageService      = sickrage;
            LogsRepo             = logsRepo;
            PushoverService      = pushoverSettings;
            PushoverApi          = pushoverApi;
            NotificationService  = notify;
            HeadphonesService    = headphones;
            NewsLetterService    = newsletter;
            LogService           = logs;
            Cache                = cache;
            SlackSettings        = slackSettings;
            SlackApi             = slackApi;
            LandingSettings      = lp;
            ScheduledJobSettings = scheduler;
            JobRecorder          = rec;
            Analytics            = analytics;
            NotifySettings       = notifyService;
            RecentlyAdded        = recentlyAdded;
            WatcherSettings      = watcherSettings;

            Before += (ctx) => Security.AdminLoginRedirect(Permissions.Administrator, ctx);

            Get["/"] = _ => Admin();

            Get["/authentication", true] = async(x, ct) => await Authentication();

            Post["/authentication", true] = async(x, ct) => await SaveAuthentication();

            Post["/", true] = async(x, ct) => await SaveAdmin();

            Post["/requestauth"] = _ => RequestAuthToken();

            Get["/getusers"] = _ => GetUsers();

            Get["/couchpotato"]  = _ => CouchPotato();
            Post["/couchpotato"] = _ => SaveCouchPotato();

            Get["/plex"]        = _ => Plex();
            Post["/plex", true] = async(x, ct) => await SavePlex();

            Get["/sonarr"]  = _ => Sonarr();
            Post["/sonarr"] = _ => SaveSonarr();

            Get["/sickrage"]  = _ => Sickrage();
            Post["/sickrage"] = _ => SaveSickrage();

            Post["/sonarrprofiles"]   = _ => GetSonarrQualityProfiles();
            Post["/cpprofiles", true] = async(x, ct) => await GetCpProfiles();

            Post["/cpapikey"] = x => GetCpApiKey();

            Get["/emailnotification"]            = _ => EmailNotifications();
            Post["/emailnotification"]           = _ => SaveEmailNotifications();
            Post["/testemailnotification", true] = async(x, ct) => await TestEmailNotifications();

            Get["/pushbulletnotification"]            = _ => PushbulletNotifications();
            Post["/pushbulletnotification"]           = _ => SavePushbulletNotifications();
            Post["/testpushbulletnotification", true] = async(x, ct) => await TestPushbulletNotifications();

            Get["/pushovernotification"]            = _ => PushoverNotifications();
            Post["/pushovernotification"]           = _ => SavePushoverNotifications();
            Post["/testpushovernotification", true] = async(x, ct) => await TestPushoverNotifications();

            Get["/logs"]      = _ => Logs();
            Get["/loglevel"]  = _ => GetLogLevels();
            Post["/loglevel"] = _ => UpdateLogLevels(Request.Form.level);
            Get["/loadlogs"]  = _ => LoadLogs();

            Get["/headphones"]  = _ => Headphones();
            Post["/headphones"] = _ => SaveHeadphones();

            Get["/newsletter"]  = _ => Newsletter();
            Post["/newsletter"] = _ => SaveNewsletter();

            Post["/createapikey"] = x => CreateApiKey();



            Post["/testslacknotification", true] = async(x, ct) => await TestSlackNotification();

            Get["/slacknotification"]  = _ => SlackNotifications();
            Post["/slacknotification"] = _ => SaveSlackNotifications();

            Get["/landingpage", true] = async(x, ct) => await LandingPage();

            Post["/landingpage", true] = async(x, ct) => await SaveLandingPage();

            Get["/scheduledjobs", true] = async(x, ct) => await GetScheduledJobs();

            Post["/scheduledjobs", true] = async(x, ct) => await SaveScheduledJobs();

            Post["/clearlogs", true] = async(x, ct) => await ClearLogs();

            Get["/notificationsettings", true] = async(x, ct) => await NotificationSettings();

            Post["/notificationsettings"] = x => SaveNotificationSettings();

            Post["/recentlyAddedTest"] = x => RecentlyAddedTest();
        }