コード例 #1
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);
        }
コード例 #2
0
 public Version1100(IUserRepository userRepo, IRequestService requestService, ISettingsService <LogSettings> log,
                    IPlexApi plexApi, ISettingsService <PlexSettings> plexService,
                    IPlexUserRepository plexusers, ISettingsService <PlexRequestSettings> prSettings,
                    ISettingsService <UserManagementSettings> umSettings,
                    ISettingsService <ScheduledJobsSettings> sjs, IRepository <UsersToNotify> usersToNotify)
 {
     UserRepo               = userRepo;
     RequestService         = requestService;
     Log                    = log;
     PlexApi                = plexApi;
     PlexSettings           = plexService;
     PlexUsers              = plexusers;
     PlexRequestSettings    = prSettings;
     UserManagementSettings = umSettings;
     ScheduledJobSettings   = sjs;
     UserNotifyRepo         = usersToNotify;
 }
コード例 #3
0
        public ApplicationTesterModule(ICouchPotatoApi cpApi, ISonarrApi sonarrApi, IPlexApi plexApi,
                                       ISickRageApi srApi, IHeadphonesApi hpApi, ISettingsService <PlexRequestSettings> pr, ISecurityExtensions security) : base("test", pr, security)
        {
            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();
            Post["/plexdb"]     = _ => TestPlexDb();
        }
コード例 #4
0
 public AddAdminCommandHandler(
     IUserService userService,
     IPlexService plexService,
     ITokenService tokenService,
     IUnitOfWork unitOfWork,
     IPlexApi plexApi,
     IOptionsSnapshot <PlexSettings> plexSettings,
     ILogger <AddAdminCommandHandler> logger
     )
 {
     _userService  = userService;
     _plexService  = plexService;
     _tokenService = tokenService;
     _unitOfWork   = unitOfWork;
     _plexApi      = plexApi;
     _plexSettings = plexSettings.Value;
     _logger       = logger;
 }
コード例 #5
0
        public ApplicationTesterModule(ICouchPotatoApi cpApi, ISonarrApi sonarrApi, IPlexApi plexApi,
                                       ISettingsService <AuthenticationSettings> authSettings, ISickRageApi srApi, IHeadphonesApi hpApi) : base("test")
        {
            this.RequiresAuthentication();

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

            Post["/cp"]         = _ => CouchPotatoTest();
            Post["/sonarr"]     = _ => SonarrTest();
            Post["/plex"]       = _ => PlexTest();
            Post["/sickrage"]   = _ => SickRageTest();
            Post["/headphones"] = _ => HeadphonesTest();
        }
コード例 #6
0
ファイル: UserWizardModule.cs プロジェクト: uzegonemad/Ombi
        public UserWizardModule(ISettingsService <PlexRequestSettings> pr, ISettingsService <PlexSettings> plex,
                                IPlexApi plexApi,
                                ISettingsService <AuthenticationSettings> auth, ICustomUserMapper m, IAnalytics a,
                                ISecurityExtensions security, IEmbyApi embyApi,
                                ISettingsService <EmbySettings> embySettings) : base("wizard", pr, security)
        {
            PlexSettings        = plex;
            PlexApi             = plexApi;
            PlexRequestSettings = pr;
            Auth         = auth;
            Mapper       = m;
            Analytics    = a;
            EmbySettings = embySettings;
            EmbyApi      = embyApi;

            Get["/", true] = async(x, ct) =>
            {
                a.TrackEventAsync(Category.Wizard, Action.Start, "Started the wizard", Username,
                                  CookieHelper.GetAnalyticClientId(Cookies));

                var settings = await PlexRequestSettings.GetSettingsAsync();

                if (settings.Wizard)
                {
                    return(Context.GetRedirect("~/search"));
                }
                return(View["Index"]);
            };
            Post["/plexAuth"]   = x => PlexAuth();
            Post["/plex", true] = async(x, ct) => await Plex();

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

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

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


            Post["/embyauth", true] = async(x, ct) => await EmbyAuth();
        }
コード例 #7
0
        public UserManagementModule(ISettingsService <PlexRequestSettings> pr, ICustomUserMapper m, IPlexApi plexApi, ISettingsService <PlexSettings> plex, IRepository <UserLogins> userLogins) : base("usermanagement", pr)
        {
#if !DEBUG
            this.RequiresClaims(UserClaims.Admin);
#endif
            UserMapper     = m;
            PlexApi        = plexApi;
            PlexSettings   = plex;
            UserLoginsRepo = userLogins;

            Get["/"] = x => Load();

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

            Post["/createuser"]     = x => CreateUser();
            Get["/local/{id}"]      = x => LocalDetails((Guid)x.id);
            Get["/plex/{id}", true] = async(x, ct) => await PlexDetails(x.id);

            Get["/claims"]      = x => GetClaims();
            Post["/updateuser"] = x => UpdateUser();
            Post["/deleteuser"] = x => DeleteUser();
        }
コード例 #8
0
ファイル: TesterController.cs プロジェクト: zobe123/Ombi
 /// <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)
 {
     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;
 }
コード例 #9
0
ファイル: RefreshMetadata.cs プロジェクト: Ombi-app/Ombi
 public RefreshMetadata(IPlexContentRepository plexRepo, IEmbyContentRepository embyRepo, IJellyfinContentRepository jellyfinRepo,
                        ILogger <RefreshMetadata> log, ITvMazeApi tvApi, ISettingsService <PlexSettings> plexSettings,
                        IMovieDbApi movieApi,
                        ISettingsService <EmbySettings> embySettings, IEmbyApiFactory embyApi,
                        ISettingsService <JellyfinSettings> jellyfinSettings, IJellyfinApiFactory jellyfinApi,
                        IHubContext <NotificationHub> notification, IMediaCacheService mediaCacheService,
                        IPlexApi plexApi)
 {
     _plexRepo           = plexRepo;
     _embyRepo           = embyRepo;
     _jellyfinRepo       = jellyfinRepo;
     _log                = log;
     _movieApi           = movieApi;
     _tvApi              = tvApi;
     _plexSettings       = plexSettings;
     _embySettings       = embySettings;
     _embyApiFactory     = embyApi;
     _jellyfinSettings   = jellyfinSettings;
     _jellyfinApiFactory = jellyfinApi;
     _notification       = notification;
     _mediaCacheService  = mediaCacheService;
     _plexApi            = plexApi;
 }
コード例 #10
0
 public IdentityController(OmbiUserManager user, IMapper mapper, RoleManager <IdentityRole> rm, IEmailProvider prov,
                           ISettingsService <EmailNotificationSettings> s,
                           ISettingsService <CustomizationSettings> c,
                           ISettingsService <OmbiSettings> ombiSettings,
                           IWelcomeEmail welcome,
                           IMovieRequestRepository m,
                           ITvRequestRepository t,
                           ILogger <IdentityController> l,
                           IPlexApi plexApi,
                           ISettingsService <PlexSettings> settings,
                           IRepository <RequestLog> requestLog,
                           IRepository <Issues> issues,
                           IRepository <IssueComments> issueComments,
                           IRepository <NotificationUserId> notificationRepository,
                           IRepository <RequestSubscription> subscriptionRepository,
                           ISettingsService <UserManagementSettings> umSettings)
 {
     UserManager           = user;
     Mapper                = mapper;
     RoleManager           = rm;
     EmailProvider         = prov;
     EmailSettings         = s;
     CustomizationSettings = c;
     WelcomeEmail          = welcome;
     MovieRepo             = m;
     TvRepo                = t;
     _log                           = l;
     _plexApi                       = plexApi;
     _plexSettings                  = settings;
     _issuesRepository              = issues;
     _requestLogRepository          = requestLog;
     _issueCommentsRepository       = issueComments;
     OmbiSettings                   = ombiSettings;
     _requestSubscriptionRepository = subscriptionRepository;
     _notificationRepository        = notificationRepository;
     _userManagementSettings        = umSettings;
 }
コード例 #11
0
ファイル: LandingPageModule.cs プロジェクト: uzegonemad/Ombi
        public LandingPageModule(ISettingsService <PlexRequestSettings> settingsService, ISettingsService <LandingPageSettings> landing,
                                 ISettingsService <PlexSettings> ps, IPlexApi pApi, IResourceLinker linker, ISecurityExtensions security, ISettingsService <EmbySettings> emby,
                                 IEmbyApi embyApi) : base("landing", settingsService, security)
        {
            LandingSettings = landing;
            PlexSettings    = ps;
            PlexApi         = pApi;
            Linker          = linker;
            EmbySettings    = emby;
            EmbyApi         = embyApi;

            Get["LandingPageIndex", "/", true] = async(x, ct) =>
            {
                var s = await LandingSettings.GetSettingsAsync();

                if (!s.BeforeLogin && string.IsNullOrEmpty(Username)) //We are signed in
                {
                    var url = Linker.BuildRelativeUri(Context, "SearchIndex").ToString();
                    return(Response.AsRedirect(url));
                }

                var model = new LandingPageViewModel
                {
                    Enabled           = s.Enabled,
                    Id                = s.Id,
                    EnabledNoticeTime = s.EnabledNoticeTime,
                    NoticeEnable      = s.NoticeEnable,
                    NoticeEnd         = s.NoticeEnd,
                    NoticeMessage     = s.NoticeMessage,
                    NoticeStart       = s.NoticeStart,
                    ContinueUrl       = s.BeforeLogin ? $"userlogin" : $"search"
                };
                return(View["Landing/Index", model]);
            };
            Get["/status", true] = async(x, ct) => await CheckStatus();
        }
コード例 #12
0
ファイル: PlexEpisodeSync.cs プロジェクト: Ombi-app/Ombi
 public PlexEpisodeSync(ISettingsService <PlexSettings> s, ILogger <PlexEpisodeSync> log, IPlexApi plexApi,
                        IPlexContentRepository repo, IHubContext <NotificationHub> hub)
 {
     _settings     = s;
     _log          = log;
     _api          = plexApi;
     _repo         = repo;
     _notification = hub;
     _settings.ClearCache();
 }
コード例 #13
0
ファイル: AdminModule.cs プロジェクト: ZinnerC/Ombi
        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();
        }
コード例 #14
0
 public PlexOAuthManager(IPlexApi api, ISettingsService <CustomizationSettings> settings)
 {
     _api = api;
     _customizationSettingsService = settings;
 }
コード例 #15
0
 public NotificationEngine(IPlexApi p, IRepository <UsersToNotify> repo, INotificationService service)
 {
     PlexApi        = p;
     UserNotifyRepo = repo;
     Notification   = service;
 }
コード例 #16
0
ファイル: UserLoginModule.cs プロジェクト: uzegonemad/Ombi
        public UserLoginModule(ISettingsService <AuthenticationSettings> auth, IPlexApi api, ISettingsService <PlexSettings> plexSettings, ISettingsService <PlexRequestSettings> pr,
                               ISettingsService <LandingPageSettings> lp, IAnalytics a, IResourceLinker linker, IRepository <UserLogins> userLogins, IExternalUserRepository <PlexUsers> plexUsers, ICustomUserMapper custom,
                               ISecurityExtensions security, ISettingsService <UserManagementSettings> userManagementSettings, IEmbyApi embyApi, ISettingsService <EmbySettings> emby, IExternalUserRepository <EmbyUsers> embyU,
                               IUserHelper userHelper)
            : base("userlogin", pr, security)
        {
            AuthService         = auth;
            LandingPageSettings = lp;
            Analytics           = a;
            PlexApi             = api;
            PlexSettings        = plexSettings;
            Linker                 = linker;
            UserLogins             = userLogins;
            PlexUserRepository     = plexUsers;
            CustomUserMapper       = custom;
            UserManagementSettings = userManagementSettings;
            EmbySettings           = emby;
            EmbyApi                = embyApi;
            EmbyUserRepository     = embyU;
            UserHelper             = userHelper;

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

            Get["/logout"] = x => Logout();

            Get["UserLoginIndex", "/", true] = async(x, ct) =>
            {
                if (Request.Query["landing"] == null)
                {
                    var s = await LandingPageSettings.GetSettingsAsync();

                    if (s.Enabled)
                    {
                        if (s.BeforeLogin) // Before login
                        {
                            if (string.IsNullOrEmpty(Username))
                            {
                                // They are not logged in
                                return
                                    (Context.GetRedirect(Linker.BuildRelativeUri(Context, "LandingPageIndex").ToString()));
                            }
                            return(Context.GetRedirect(Linker.BuildRelativeUri(Context, "SearchIndex").ToString()));
                        }

                        // After login
                        if (string.IsNullOrEmpty(Username))
                        {
                            // Not logged in yet
                            return(Context.GetRedirect(Linker.BuildRelativeUri(Context, "UserLoginIndex").ToString() + "?landing"));
                        }
                        // Send them to landing
                        var landingUrl = Linker.BuildRelativeUri(Context, "LandingPageIndex").ToString();
                        return(Context.GetRedirect(landingUrl));
                    }
                }

                if (!string.IsNullOrEmpty(Username) || IsAdmin)
                {
                    var url = Linker.BuildRelativeUri(Context, "SearchIndex").ToString();
                    return(Response.AsRedirect(url));
                }
                var settings = await AuthService.GetSettingsAsync();

                return(View["Username", settings]);
            };

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

            Post["/password", true] = async(x, ct) => await PasswordLogin();
        }
コード例 #17
0
 public HomeController(IPlexApi plexApi)
 {
     _plexApi = plexApi;
 }
コード例 #18
0
 public PlexAvailabilityChecker(ISettingsService <PlexSettings> plexSettings, IRequestService request, IPlexApi plex, ICacheProvider cache,
                                INotificationService notify, IJobRecord rec, IRepository <UsersToNotify> users, IRepository <PlexEpisodes> repo, INotificationEngine e, IRepository <PlexContent> content)
 {
     Plex               = plexSettings;
     RequestService     = request;
     PlexApi            = plex;
     Cache              = cache;
     Notification       = notify;
     Job                = rec;
     UserNotifyRepo     = users;
     EpisodeRepo        = repo;
     NotificationEngine = e;
     PlexContent        = content;
 }
コード例 #19
0
 public PlexAvailabilityChecker(ISettingsService<PlexSettings> plexSettings, ISettingsService<AuthenticationSettings> auth, IRequestService request, IPlexApi plex, ICacheProvider cache,
     INotificationService notify, IJobRecord rec, IRepository<UsersToNotify> users)
 {
     Plex = plexSettings;
     Auth = auth;
     RequestService = request;
     PlexApi = plex;
     Cache = cache;
     Notification = notify;
     Job = rec;
     UserNotifyRepo = users;
 }
コード例 #20
0
ファイル: PlexEpisodeSync.cs プロジェクト: sonicos/Ombi
 public PlexEpisodeSync(ISettingsService <PlexSettings> s, ILogger <PlexEpisodeSync> log, IPlexApi plexApi,
                        IPlexContentRepository repo, IPlexAvailabilityChecker a)
 {
     _settings            = s;
     _log                 = log;
     _api                 = plexApi;
     _repo                = repo;
     _availabilityChecker = a;
     _settings.ClearCache();
 }
コード例 #21
0
 public MainWindowViewModel(IPlexApi plexApi)
 {
     this.Router.Navigate.Execute(new PlexLoginViewModel(this, plexApi));
 }
コード例 #22
0
ファイル: MediaDatabaseRefresh.cs プロジェクト: tombomb/Ombi
 public MediaDatabaseRefresh(ISettingsService <PlexSettings> s, ILogger <MediaDatabaseRefresh> log, IPlexApi plexApi,
                             IPlexContentRepository plexRepo, IPlexContentSync c, IEmbyContentRepository embyRepo, IEmbyContentSync embySync)
 {
     _settings        = s;
     _log             = log;
     _api             = plexApi;
     _plexRepo        = plexRepo;
     _plexContentSync = c;
     _embyRepo        = embyRepo;
     _embyContentSync = embySync;
     _settings.ClearCache();
 }
コード例 #23
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();
        }
コード例 #24
0
ファイル: UserManagementModule.cs プロジェクト: ZinnerC/Ombi
        public UserManagementModule(ISettingsService <PlexRequestSettings> pr, ICustomUserMapper m, IPlexApi plexApi, ISettingsService <PlexSettings> plex, IRepository <UserLogins> userLogins, IPlexUserRepository plexRepo
                                    , ISecurityExtensions security, IRequestService req, IAnalytics ana) : base("usermanagement", pr, security)
        {
#if !DEBUG
            Before += (ctx) => Security.AdminLoginRedirect(Permissions.Administrator, ctx);
#endif
            UserMapper          = m;
            PlexApi             = plexApi;
            PlexSettings        = plex;
            UserLoginsRepo      = userLogins;
            PlexUsersRepository = plexRepo;
            PlexRequestSettings = pr;
            RequestService      = req;
            Analytics           = ana;

            Get["/"] = x => Load();

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

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

            Get["/local/{id}"]      = x => LocalDetails((Guid)x.id);
            Get["/plex/{id}", true] = async(x, ct) => await PlexDetails(x.id);

            Get["/permissions"]       = x => GetEnum <Permissions>();
            Get["/features"]          = x => GetEnum <Features>();
            Post["/updateuser", true] = async(x, ct) => await UpdateUser();

            Post["/deleteuser"] = x => DeleteUser();
        }
コード例 #25
0
 public WrappedService(IPlexApi plexApi, ITautulliApi tautulliApi)
 {
     this.plexApi     = plexApi;
     this.tautulliApi = tautulliApi;
 }
コード例 #26
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();
        }
コード例 #27
0
 public PlexAvailabilityChecker(ISettingsService <PlexSettings> plexSettings, ISettingsService <AuthenticationSettings> auth, IRequestService request, IPlexApi plex, ICacheProvider cache)
 {
     Plex           = plexSettings;
     Auth           = auth;
     RequestService = request;
     PlexApi        = plex;
     Cache          = cache;
 }
コード例 #28
0
ファイル: OmbiUserManager.cs プロジェクト: itzfk0/ombi
 public OmbiUserManager(IUserStore <OmbiUser> store, IOptions <IdentityOptions> optionsAccessor,
                        IPasswordHasher <OmbiUser> passwordHasher, IEnumerable <IUserValidator <OmbiUser> > userValidators,
                        IEnumerable <IPasswordValidator <OmbiUser> > passwordValidators, ILookupNormalizer keyNormalizer,
                        IdentityErrorDescriber errors, IServiceProvider services, ILogger <UserManager <OmbiUser> > logger, IPlexApi plexApi,
                        IEmbyApi embyApi, ISettingsService <EmbySettings> embySettings, ISettingsService <AuthenticationSettings> auth)
     : base(store, optionsAccessor, passwordHasher, userValidators, passwordValidators, keyNormalizer, errors, services, logger)
 {
     _plexApi      = plexApi;
     _embyApi      = embyApi;
     _embySettings = embySettings;
     _authSettings = auth;
 }
コード例 #29
0
ファイル: PlexOAuthManager.cs プロジェクト: anojht/Ombi
 public PlexOAuthManager(IPlexApi api, ISettingsService <CustomizationSettings> settings, ILogger <PlexOAuthManager> logger)
 {
     _api = api;
     _customizationSettingsService = settings;
     _logger = logger;
 }