Esempio n. 1
0
        public FaultQueueHandler(IJobRecord record, IRepository <RequestQueue> repo, ISonarrApi sonarrApi,
                                 ISickRageApi srApi, ISettingsService <SonarrSettings> sonarrSettings, ISettingsService <SickRageSettings> srSettings,
                                 ICouchPotatoApi cpApi, ISettingsService <CouchPotatoSettings> cpsettings, IRequestService requestService,
                                 ISettingsService <HeadphonesSettings> hpSettings, IHeadphonesApi headphonesApi, ISettingsService <PlexRequestSettings> prSettings,
                                 ISecurityExtensions security, IMovieSender movieSender, ICacheProvider cache)
        {
            Record    = record;
            Repo      = repo;
            SonarrApi = sonarrApi;
            SrApi     = srApi;
            CpApi     = cpApi;
            HpApi     = headphonesApi;

            RequestService = requestService;

            SickrageSettings  = srSettings;
            SonarrSettings    = sonarrSettings;
            CpSettings        = cpsettings;
            HeadphoneSettings = hpSettings;
            Security          = security;
            PrSettings        = prSettings.GetSettings();
            MovieSender       = movieSender;

            Cache = cache;
        }
Esempio n. 2
0
        public ApprovalModule(IRequestService service, ISettingsService <CouchPotatoSettings> cpService, ICouchPotatoApi cpApi, ISonarrApi sonarrApi,
                              ISettingsService <SonarrSettings> sonarrSettings, ISickRageApi srApi, ISettingsService <SickRageSettings> srSettings,
                              ISettingsService <HeadphonesSettings> hpSettings, IHeadphonesApi hpApi, ISettingsService <PlexRequestSettings> pr) : base("approval", pr)
        {
            this.RequiresAnyClaim(UserClaims.Admin, UserClaims.PowerUser);

            Service            = service;
            CpService          = cpService;
            CpApi              = cpApi;
            SonarrApi          = sonarrApi;
            SonarrSettings     = sonarrSettings;
            SickRageApi        = srApi;
            SickRageSettings   = srSettings;
            HeadphonesSettings = hpSettings;
            HeadphoneApi       = hpApi;

            Post["/approve", true] = async(x, ct) => await Approve((int)Request.Form.requestid, (string)Request.Form.qualityId);

            Post["/deny", true] = async(x, ct) => await DenyRequest((int)Request.Form.requestid, (string)Request.Form.reason);

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

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

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

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

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

            Post["/deleteallalbums", true] = async(x, ct) => await DeleteAllAlbums();
        }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TesterController" /> class.
 /// </summary>
 public TesterController(INotificationService service, IDiscordNotification notification, IEmailNotification emailN,
                         IPushbulletNotification pushbullet, ISlackNotification slack, IPushoverNotification po, IMattermostNotification mm,
                         IPlexApi plex, IEmbyApi emby, IRadarrApi radarr, ISonarrApi sonarr, ILogger <TesterController> log, IEmailProvider provider,
                         ICouchPotatoApi cpApi, ITelegramNotification telegram, ISickRageApi srApi, INewsletterJob newsletter, IMobileNotification mobileNotification,
                         ILidarrApi lidarrApi, IGotifyNotification gotifyNotification)
 {
     Service                = service;
     DiscordNotification    = notification;
     EmailNotification      = emailN;
     PushbulletNotification = pushbullet;
     SlackNotification      = slack;
     PushoverNotification   = po;
     MattermostNotification = mm;
     PlexApi                = plex;
     RadarrApi              = radarr;
     EmbyApi                = emby;
     SonarrApi              = sonarr;
     Log                  = log;
     EmailProvider        = provider;
     CouchPotatoApi       = cpApi;
     TelegramNotification = telegram;
     SickRageApi          = srApi;
     Newsletter           = newsletter;
     MobileNotification   = mobileNotification;
     LidarrApi            = lidarrApi;
     GotifyNotification   = gotifyNotification;
 }
Esempio n. 4
0
        public ApplicationTesterModule(ICouchPotatoApi cpApi, ISonarrApi sonarrApi, IPlexApi plexApi,
                                       ISickRageApi srApi, IHeadphonesApi hpApi, ISettingsService <PlexRequestSettings> pr, ISecurityExtensions security,
                                       IWatcherApi watcherApi, IRadarrApi radarrApi, IEmbyApi emby) : base("test", pr, security)
        {
            this.RequiresAuthentication();

            CpApi         = cpApi;
            SonarrApi     = sonarrApi;
            PlexApi       = plexApi;
            SickRageApi   = srApi;
            HeadphonesApi = hpApi;
            WatcherApi    = watcherApi;
            RadarrApi     = radarrApi;
            Emby          = emby;

            Post["/cp"]         = _ => CouchPotatoTest();
            Post["/sonarr"]     = _ => SonarrTest();
            Post["/radarr"]     = _ => RadarrTest();
            Post["/plex"]       = _ => PlexTest();
            Post["/sickrage"]   = _ => SickRageTest();
            Post["/headphones"] = _ => HeadphonesTest();
            Post["/plexdb"]     = _ => TestPlexDb();
            Post["/watcher"]    = _ => WatcherTest();
            Post["/emby"]       = _ => EmbyTest();
        }
Esempio n. 5
0
 public CouchPotatoCacher(ISettingsService <CouchPotatoSettings> cpSettings, ICouchPotatoApi cpApi, ICacheProvider cache, IJobRecord rec)
 {
     CpSettings = cpSettings;
     CpApi      = cpApi;
     Cache      = cache;
     Job        = rec;
 }
Esempio n. 6
0
        public ApprovalModule(IRequestService service, ISettingsService <CouchPotatoSettings> cpService, ICouchPotatoApi cpApi, ISonarrApi sonarrApi,
                              ISettingsService <SonarrSettings> sonarrSettings, ISickRageApi srApi, ISettingsService <SickRageSettings> srSettings,
                              ISettingsService <HeadphonesSettings> hpSettings, IHeadphonesApi hpApi, ISettingsService <PlexRequestSettings> pr, ITransientFaultQueue faultQueue
                              , ISecurityExtensions security) : base("approval", pr, security)
        {
            Before += (ctx) => Security.AdminLoginRedirect(ctx, Permissions.Administrator, Permissions.ManageRequests);

            Service            = service;
            CpService          = cpService;
            CpApi              = cpApi;
            SonarrApi          = sonarrApi;
            SonarrSettings     = sonarrSettings;
            SickRageApi        = srApi;
            SickRageSettings   = srSettings;
            HeadphonesSettings = hpSettings;
            HeadphoneApi       = hpApi;
            FaultQueue         = faultQueue;

            Post["/approve", true] = async(x, ct) => await Approve((int)Request.Form.requestid, (string)Request.Form.qualityId);

            Post["/deny", true] = async(x, ct) => await DenyRequest((int)Request.Form.requestid, (string)Request.Form.reason);

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

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

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

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

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

            Post["/deleteallalbums", true] = async(x, ct) => await DeleteAllAlbums();
        }
Esempio n. 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TesterController" /> class.
 /// </summary>
 public TesterController(INotificationService service, IDiscordNotification notification, IEmailNotification emailN,
                         IPushbulletNotification pushbullet, ISlackNotification slack, IPushoverNotification po, IMattermostNotification mm,
                         IPlexApi plex, IEmbyApiFactory emby, IRadarrApi radarr, ISonarrApi sonarr, ILogger <TesterController> log, IEmailProvider provider,
                         ICouchPotatoApi cpApi, ITelegramNotification telegram, ISickRageApi srApi, INewsletterJob newsletter, ILegacyMobileNotification mobileNotification,
                         ILidarrApi lidarrApi, IGotifyNotification gotifyNotification, IWhatsAppApi whatsAppApi, OmbiUserManager um, IWebhookNotification webhookNotification,
                         IJellyfinApi jellyfinApi)
 {
     Service                = service;
     DiscordNotification    = notification;
     EmailNotification      = emailN;
     PushbulletNotification = pushbullet;
     SlackNotification      = slack;
     PushoverNotification   = po;
     MattermostNotification = mm;
     PlexApi                = plex;
     RadarrApi              = radarr;
     EmbyApi                = emby;
     SonarrApi              = sonarr;
     Log                  = log;
     EmailProvider        = provider;
     CouchPotatoApi       = cpApi;
     TelegramNotification = telegram;
     SickRageApi          = srApi;
     Newsletter           = newsletter;
     MobileNotification   = mobileNotification;
     LidarrApi            = lidarrApi;
     GotifyNotification   = gotifyNotification;
     WhatsAppApi          = whatsAppApi;
     UserManager          = um;
     WebhookNotification  = webhookNotification;
     _jellyfinApi         = jellyfinApi;
 }
Esempio n. 8
0
        public SearchModule(ICacheProvider cache, ISettingsService <CouchPotatoSettings> cpSettings,
                            ISettingsService <PlexRequestSettings> prSettings, IAvailabilityChecker checker,
                            IRequestService request, ISonarrApi sonarrApi, ISettingsService <SonarrSettings> sonarrSettings,
                            ISettingsService <SickRageSettings> sickRageService, ICouchPotatoApi cpApi, ISickRageApi srApi,
                            INotificationService notify, IMusicBrainzApi mbApi, IHeadphonesApi hpApi, ISettingsService <HeadphonesSettings> hpService,
                            ICouchPotatoCacher cpCacher, ISonarrCacher sonarrCacher, ISickRageCacher sickRageCacher, IPlexApi plexApi,
                            ISettingsService <PlexSettings> plexService, ISettingsService <AuthenticationSettings> auth, IRepository <UsersToNotify> u, ISettingsService <EmailNotificationSettings> email) : base("search", prSettings)
        {
            Auth                      = auth;
            PlexService               = plexService;
            PlexApi                   = plexApi;
            CpService                 = cpSettings;
            PrService                 = prSettings;
            MovieApi                  = new TheMovieDbApi();
            Cache                     = cache;
            Checker                   = checker;
            CpCacher                  = cpCacher;
            SonarrCacher              = sonarrCacher;
            SickRageCacher            = sickRageCacher;
            RequestService            = request;
            SonarrApi                 = sonarrApi;
            SonarrService             = sonarrSettings;
            CouchPotatoApi            = cpApi;
            SickRageService           = sickRageService;
            SickrageApi               = srApi;
            NotificationService       = notify;
            MusicBrainzApi            = mbApi;
            HeadphonesApi             = hpApi;
            HeadphonesService         = hpService;
            UsersToNotifyRepo         = u;
            EmailNotificationSettings = email;


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

            Get["movie/{searchTerm}", true] = async(x, ct) => await SearchMovie((string)x.searchTerm);

            Get["tv/{searchTerm}", true] = async(x, ct) => await SearchTvShow((string)x.searchTerm);

            Get["music/{searchTerm}", true] = async(x, ct) => await SearchMusic((string)x.searchTerm);

            Get["music/coverArt/{id}"] = p => GetMusicBrainzCoverArt((string)p.id);

            Get["movie/upcoming", true] = async(x, ct) => await UpcomingMovies();

            Get["movie/playing", true] = async(x, ct) => await CurrentlyPlayingMovies();

            Post["request/movie", true] = async(x, ct) => await RequestMovie((int)Request.Form.movieId);

            Post["request/tv", true] = async(x, ct) => await RequestTvShow((int)Request.Form.tvId, (string)Request.Form.seasons);

            Post["request/album", true] = async(x, ct) => await RequestAlbum((string)Request.Form.albumId);

            Post["/notifyuser", true] = async(x, ct) => await NotifyUser((bool)Request.Form.notify);

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

            Get["/seasons"] = x => GetSeasons();
        }
Esempio n. 9
0
        private bool SendMovie(CouchPotatoSettings settings, RequestedModel r, ICouchPotatoApi cp)
        {
            Log.Info("Adding movie to CP : {0}", r.Title);
            var result = cp.AddMovie(r.ImdbId, settings.ApiKey, r.Title, settings.FullUri, settings.ProfileId);

            Log.Trace("Adding movie to CP result {0}", result);
            return(result);
        }
Esempio n. 10
0
 public MovieSender(ISettingsService <CouchPotatoSettings> cp, ISettingsService <WatcherSettings> watcher,
                    ICouchPotatoApi cpApi, IWatcherApi watcherApi)
 {
     CouchPotatoSettings = cp;
     WatcherSettings     = watcher;
     CpApi      = cpApi;
     WatcherApi = watcherApi;
 }
Esempio n. 11
0
 public CouchPotatoSync(ISettingsService <CouchPotatoSettings> cpSettings,
                        ICouchPotatoApi api, ILogger <CouchPotatoSync> log, IExternalContext ctx)
 {
     _settings = cpSettings;
     _api      = api;
     _log      = log;
     _ctx      = ctx;
     _settings.ClearCache();
 }
Esempio n. 12
0
 public MovieSender(ISettingsService <CouchPotatoSettings> cp, ISettingsService <WatcherSettings> watcher,
                    ICouchPotatoApi cpApi, IWatcherApi watcherApi, IRadarrApi radarrApi, ISettingsService <RadarrSettings> radarrSettings)
 {
     CouchPotatoSettings = cp;
     WatcherSettings     = watcher;
     CpApi          = cpApi;
     WatcherApi     = watcherApi;
     RadarrSettings = radarrSettings;
     RadarrApi      = radarrApi;
 }
Esempio n. 13
0
 public CouchPotatoSync(ISettingsService <CouchPotatoSettings> cpSettings,
                        ICouchPotatoApi api, ILogger <CouchPotatoSync> log, ExternalContext ctx, IHubContext <NotificationHub> hub)
 {
     _settings     = cpSettings;
     _api          = api;
     _log          = log;
     _ctx          = ctx;
     _notification = hub;
     _settings.ClearCache();
 }
Esempio n. 14
0
        public RequestsModule(
            IRequestService service,
            ISettingsService <PlexRequestSettings> prSettings,
            ISettingsService <PlexSettings> plex,
            INotificationService notify,
            ISettingsService <SonarrSettings> sonarrSettings,
            ISettingsService <SickRageSettings> sickRageSettings,
            ISettingsService <CouchPotatoSettings> cpSettings,
            ICouchPotatoApi cpApi,
            ISonarrApi sonarrApi,
            ISickRageApi sickRageApi,
            ICacheProvider cache,
            IAnalytics an,
            INotificationEngine engine,
            ISecurityExtensions security,
            ISettingsService <CustomizationSettings> customSettings) : base("requests", prSettings, security)
        {
            Service             = service;
            PrSettings          = prSettings;
            PlexSettings        = plex;
            NotificationService = notify;
            SonarrSettings      = sonarrSettings;
            SickRageSettings    = sickRageSettings;
            CpSettings          = cpSettings;
            SonarrApi           = sonarrApi;
            SickRageApi         = sickRageApi;
            CpApi                 = cpApi;
            Cache                 = cache;
            Analytics             = an;
            NotificationEngine    = engine;
            CustomizationSettings = customSettings;

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

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

            Get["/tvshows", true] = async(c, ct) => await GetTvShows();

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

            Post["/delete", true] = async(x, ct) => await DeleteRequest((int)Request.Form.id);

            Post["/reportissue", true] = async(x, ct) => await ReportIssue((int)Request.Form.requestId, (IssueState)(int)Request.Form.issue, null);

            Post["/reportissuecomment", true] = async(x, ct) => await ReportIssue((int)Request.Form.requestId, IssueState.Other, (string)Request.Form.commentArea);

            Post["/clearissues", true] = async(x, ct) => await ClearIssue((int)Request.Form.Id);

            Post["/changeavailability", true] = async(x, ct) => await ChangeRequestAvailability((int)Request.Form.Id, (bool)Request.Form.Available);

            Post["/changeRootFolder", true] = async(x, ct) => await ChangeRootFolder((int)Request.Form.requestId, (int)Request.Form.rootFolderId);

            Get["/UpdateFilters", true] = async(x, ct) => await GetFilterAndSortSettings();
        }
Esempio n. 15
0
 public MovieSender(ISettingsService <RadarrSettings> radarrSettings, IRadarrApi api, ILogger <MovieSender> log,
                    ISettingsService <DogNzbSettings> dogSettings, IDogNzbApi dogApi, ISettingsService <CouchPotatoSettings> cpSettings,
                    ICouchPotatoApi cpApi)
 {
     RadarrSettings      = radarrSettings;
     RadarrApi           = api;
     Log                 = log;
     DogNzbSettings      = dogSettings;
     DogNzbApi           = dogApi;
     CouchPotatoSettings = cpSettings;
     CouchPotatoApi      = cpApi;
 }
Esempio n. 16
0
        public RequestsBetaModule(
            IRequestService service,
            ISettingsService <PlexRequestSettings> prSettings,
            ISettingsService <RequestSettings> requestSettings,
            ISettingsService <PlexSettings> plex,
            INotificationService notify,
            ISettingsService <SonarrSettings> sonarrSettings,
            ISettingsService <SickRageSettings> sickRageSettings,
            ISettingsService <CouchPotatoSettings> cpSettings,
            ICouchPotatoApi cpApi,
            ISonarrApi sonarrApi,
            ISickRageApi sickRageApi,
            ICacheProvider cache,
            IAnalytics an) : base("requestsbeta", prSettings)
        {
            Service             = service;
            PrSettings          = prSettings;
            PlexSettings        = plex;
            NotificationService = notify;
            SonarrSettings      = sonarrSettings;
            SickRageSettings    = sickRageSettings;
            CpSettings          = cpSettings;
            SonarrApi           = sonarrApi;
            SickRageApi         = sickRageApi;
            CpApi     = cpApi;
            Cache     = cache;
            Analytics = an;

            Get["/"] = x => LoadRequests();
            Get["/plexrequestsettings", true] = async(x, ct) => await GetPlexRequestSettings();

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

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

            Get["/movies/{searchTerm}", true] = async(x, ct) => await GetMovies((string)x.searchTerm);


            // Everything below is not being used in the beta page
            Get["/tvshows", true] = async(c, ct) => await GetTvShows();

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

            Post["/delete", true] = async(x, ct) => await DeleteRequest((int)Request.Form.id);

            Post["/reportissue", true] = async(x, ct) => await ReportIssue((int)Request.Form.requestId, (IssueState)(int)Request.Form.issue, null);

            Post["/reportissuecomment", true] = async(x, ct) => await ReportIssue((int)Request.Form.requestId, IssueState.Other, (string)Request.Form.commentArea);

            Post["/clearissues", true] = async(x, ct) => await ClearIssue((int)Request.Form.Id);

            Post["/changeavailability", true] = async(x, ct) => await ChangeRequestAvailability((int)Request.Form.Id, (bool)Request.Form.Available);
        }
Esempio n. 17
0
 public MovieSender(ISettingsService <RadarrSettings> radarrSettings, IRadarrApi api, ILogger <MovieSender> log,
                    ISettingsService <DogNzbSettings> dogSettings, IDogNzbApi dogApi, ISettingsService <CouchPotatoSettings> cpSettings,
                    ICouchPotatoApi cpApi, IRepository <UserQualityProfiles> userProfiles)
 {
     RadarrSettings      = radarrSettings;
     RadarrApi           = api;
     Log                 = log;
     DogNzbSettings      = dogSettings;
     DogNzbApi           = dogApi;
     CouchPotatoSettings = cpSettings;
     CouchPotatoApi      = cpApi;
     _userProfiles       = userProfiles;
 }
Esempio n. 18
0
 public MovieSender(ISettingsService <RadarrSettings> radarrSettings, IRadarrApi api, ILogger <MovieSender> log,
                    ISettingsService <DogNzbSettings> dogSettings, IDogNzbApi dogApi, ISettingsService <CouchPotatoSettings> cpSettings,
                    ICouchPotatoApi cpApi, IRepository <UserQualityProfiles> userProfiles, IRepository <RequestQueue> requestQueue, INotificationHelper notify)
 {
     RadarrSettings         = radarrSettings;
     RadarrApi              = api;
     Log                    = log;
     DogNzbSettings         = dogSettings;
     DogNzbApi              = dogApi;
     CouchPotatoSettings    = cpSettings;
     CouchPotatoApi         = cpApi;
     _userProfiles          = userProfiles;
     _requestQueuRepository = requestQueue;
     _notificationHelper    = notify;
 }
Esempio n. 19
0
        public ApplicationTesterModule(ICouchPotatoApi cpApi, ISonarrApi sonarrApi, IPlexApi plexApi,
                                       ISickRageApi srApi, IHeadphonesApi hpApi, ISettingsService <PlexRequestSettings> pr) : base("test", pr)
        {
            this.RequiresAuthentication();

            CpApi         = cpApi;
            SonarrApi     = sonarrApi;
            PlexApi       = plexApi;
            SickRageApi   = srApi;
            HeadphonesApi = hpApi;

            Post["/cp"]         = _ => CouchPotatoTest();
            Post["/sonarr"]     = _ => SonarrTest();
            Post["/plex"]       = _ => PlexTest();
            Post["/sickrage"]   = _ => SickRageTest();
            Post["/headphones"] = _ => HeadphonesTest();
        }
Esempio n. 20
0
        public SearchModule(ICacheProvider cache, ISettingsService <CouchPotatoSettings> cpSettings,
                            ISettingsService <PlexRequestSettings> prSettings, IAvailabilityChecker checker,
                            IRequestService request, ISonarrApi sonarrApi, ISettingsService <SonarrSettings> sonarrSettings,
                            ISettingsService <SickRageSettings> sickRageService, ICouchPotatoApi cpApi, ISickRageApi srApi,
                            INotificationService notify, IMusicBrainzApi mbApi, IHeadphonesApi hpApi, ISettingsService <HeadphonesSettings> hpService,
                            ICouchPotatoCacher cpCacher, ISonarrCacher sonarrCacher, ISickRageCacher sickRageCacher, IPlexApi plexApi,
                            ISettingsService <PlexSettings> plexService, ISettingsService <AuthenticationSettings> auth) : base("search")
        {
            Auth                = auth;
            PlexService         = plexService;
            PlexApi             = plexApi;
            CpService           = cpSettings;
            PrService           = prSettings;
            MovieApi            = new TheMovieDbApi();
            TvApi               = new TheTvDbApi();
            Cache               = cache;
            Checker             = checker;
            CpCacher            = cpCacher;
            SonarrCacher        = sonarrCacher;
            SickRageCacher      = sickRageCacher;
            RequestService      = request;
            SonarrApi           = sonarrApi;
            SonarrService       = sonarrSettings;
            CouchPotatoApi      = cpApi;
            SickRageService     = sickRageService;
            SickrageApi         = srApi;
            NotificationService = notify;
            MusicBrainzApi      = mbApi;
            HeadphonesApi       = hpApi;
            HeadphonesService   = hpService;


            Get["/"] = parameters => RequestLoad();

            Get["movie/{searchTerm}"]  = parameters => SearchMovie((string)parameters.searchTerm);
            Get["tv/{searchTerm}"]     = parameters => SearchTvShow((string)parameters.searchTerm);
            Get["music/{searchTerm}"]  = parameters => SearchMusic((string)parameters.searchTerm);
            Get["music/coverArt/{id}"] = p => GetMusicBrainzCoverArt((string)p.id);

            Get["movie/upcoming"] = parameters => UpcomingMovies();
            Get["movie/playing"]  = parameters => CurrentlyPlayingMovies();

            Post["request/movie"] = parameters => RequestMovie((int)Request.Form.movieId);
            Post["request/tv"]    = parameters => RequestTvShow((int)Request.Form.tvId, (string)Request.Form.seasons);
            Post["request/album"] = parameters => RequestAlbum((string)Request.Form.albumId);
        }
Esempio n. 21
0
        public RequestsModule(
            IRequestService service,
            ISettingsService <PlexRequestSettings> prSettings,
            ISettingsService <PlexSettings> plex,
            INotificationService notify,
            ISettingsService <SonarrSettings> sonarrSettings,
            ISettingsService <SickRageSettings> sickRageSettings,
            ISettingsService <CouchPotatoSettings> cpSettings,
            ICouchPotatoApi cpApi,
            ISonarrApi sonarrApi,
            ISickRageApi sickRageApi,
            ICacheProvider cache) : base("requests", prSettings)
        {
            Service             = service;
            PrSettings          = prSettings;
            PlexSettings        = plex;
            NotificationService = notify;
            SonarrSettings      = sonarrSettings;
            SickRageSettings    = sickRageSettings;
            CpSettings          = cpSettings;
            SonarrApi           = sonarrApi;
            SickRageApi         = sickRageApi;
            CpApi = cpApi;
            Cache = cache;

            Get["/"]             = _ => LoadRequests();
            Get["/movies", true] = async(x, ct) => await GetMovies();

            Get["/tvshows", true] = async(c, ct) => await GetTvShows();

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

            Post["/delete", true] = async(x, ct) => await DeleteRequest((int)Request.Form.id);

            Post["/reportissue", true] = async(x, ct) => await ReportIssue((int)Request.Form.requestId, (IssueState)(int)Request.Form.issue, null);

            Post["/reportissuecomment", true] = async(x, ct) => await ReportIssue((int)Request.Form.requestId, IssueState.Other, (string)Request.Form.commentArea);

            Post["/clearissues", true] = async(x, ct) => await ClearIssue((int)Request.Form.Id);

            Post["/changeavailability", true] = async(x, ct) => await ChangeRequestAvailability((int)Request.Form.Id, (bool)Request.Form.Available);

            Post["/addnote", true] = async(x, ct) => await AddNote((int)Request.Form.requestId, (string)Request.Form.noteArea);
        }
        public ApprovalModule(IRequestService service, ISettingsService <CouchPotatoSettings> cpService, ICouchPotatoApi cpApi, ISonarrApi sonarrApi,
                              ISettingsService <SonarrSettings> sonarrSettings, ISickRageApi srApi, ISettingsService <SickRageSettings> srSettings,
                              ISettingsService <HeadphonesSettings> hpSettings, IHeadphonesApi hpApi, ISettingsService <PlexRequestSettings> pr) : base("approval", pr)
        {
            this.RequiresClaims(UserClaims.Admin);

            Service            = service;
            CpService          = cpService;
            CpApi              = cpApi;
            SonarrApi          = sonarrApi;
            SonarrSettings     = sonarrSettings;
            SickRageApi        = srApi;
            SickRageSettings   = srSettings;
            HeadphonesSettings = hpSettings;
            HeadphoneApi       = hpApi;

            Post["/approve"]           = parameters => Approve((int)Request.Form.requestid, (string)Request.Form.qualityId);
            Post["/approveall"]        = x => ApproveAll();
            Post["/approveallmovies"]  = x => ApproveAllMovies();
            Post["/approvealltvshows"] = x => ApproveAllTVShows();
        }
Esempio n. 23
0
 public CouchPotatoController(ICouchPotatoApi api)
 {
     _api = api;
 }
Esempio n. 24
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,
                           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();
        }
Esempio n. 25
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();
        }
 public CouchPotatoCacher(ISettingsService <CouchPotatoSettings> cpSettings, ICouchPotatoApi cpApi, ICacheProvider cache)
 {
     CpSettings = cpSettings;
     CpApi      = cpApi;
     Cache      = cache;
 }