Exemple #1
0
 public ChatBot(IServiceProvider serviceProvider, ILogger <ChatBot> logger, DiscordSettingsProvider discordSettingsProvider)
 {
     _logger                  = logger;
     _serviceProvider         = serviceProvider;
     _discordSettingsProvider = discordSettingsProvider;
     _overseerrClient         = new OverseerrClient(serviceProvider.Get <IHttpClientFactory>(), serviceProvider.Get <ILogger <OverseerrClient> >(), serviceProvider.Get <OverseerrSettingsProvider>());
     _ombiDownloadClient      = new OmbiClient(serviceProvider.Get <IHttpClientFactory>(), serviceProvider.Get <ILogger <OmbiClient> >(), serviceProvider.Get <OmbiSettingsProvider>());
     _radarrDownloadClient    = new RadarrClient(serviceProvider.Get <IHttpClientFactory>(), serviceProvider.Get <ILogger <RadarrClient> >(), serviceProvider.Get <RadarrSettingsProvider>());
     _sonarrDownloadClient    = new SonarrClient(serviceProvider.Get <IHttpClientFactory>(), serviceProvider.Get <ILogger <SonarrClient> >(), serviceProvider.Get <SonarrSettingsProvider>());
 }
Exemple #2
0
 public ChatBot(IServiceProvider serviceProvider, ILogger <ChatBot> logger, DiscordSettingsProvider discordSettingsProvider)
 {
     _logger                  = logger;
     _serviceProvider         = serviceProvider;
     _discordSettingsProvider = discordSettingsProvider;
     _overseerrClient         = new OverseerrClient(serviceProvider.Get <IHttpClientFactory>(), serviceProvider.Get <ILogger <OverseerrClient> >(), serviceProvider.Get <OverseerrSettingsProvider>());
     _ombiDownloadClient      = new OmbiClient(serviceProvider.Get <IHttpClientFactory>(), serviceProvider.Get <ILogger <OmbiClient> >(), serviceProvider.Get <OmbiSettingsProvider>());
     _radarrDownloadClient    = new RadarrClient(serviceProvider.Get <IHttpClientFactory>(), serviceProvider.Get <ILogger <RadarrClient> >(), serviceProvider.Get <RadarrSettingsProvider>());
     _sonarrDownloadClient    = new SonarrClient(serviceProvider.Get <IHttpClientFactory>(), serviceProvider.Get <ILogger <SonarrClient> >(), serviceProvider.Get <SonarrSettingsProvider>());
     _movieWorkflowFactory    = new MovieWorkflowFactory(_discordSettingsProvider, _movieNotificationRepository, _overseerrClient, _ombiDownloadClient, _radarrDownloadClient);
     _tvShowWorkflowFactory   = new TvShowWorkflowFactory(serviceProvider.Get <TvShowsSettingsProvider>(), _discordSettingsProvider, _tvShowNotificationRepository, _overseerrClient, _ombiDownloadClient, _sonarrDownloadClient);
 }
Exemple #3
0
 public MovieWorkflowFactory(
     DiscordSettingsProvider settingsProvider,
     MovieNotificationsRepository notificationsRepository,
     OverseerrClient overseerrClient,
     OmbiClient ombiDownloadClient,
     RadarrClient radarrDownloadClient)
 {
     _settingsProvider        = settingsProvider;
     _notificationsRepository = notificationsRepository;
     _overseerrClient         = overseerrClient;
     _ombiDownloadClient      = ombiDownloadClient;
     _radarrDownloadClient    = radarrDownloadClient;
 }
Exemple #4
0
 public TvShowWorkflowFactory(
     TvShowsSettingsProvider tvShowsSettingsProvider,
     DiscordSettingsProvider settingsProvider,
     TvShowNotificationsRepository notificationsRepository,
     OverseerrClient overseerrClient,
     OmbiClient ombiDownloadClient,
     SonarrClient radarrDownloadClient)
 {
     _tvShowsSettingsProvider = tvShowsSettingsProvider;
     _settingsProvider        = settingsProvider;
     _notificationsRepository = notificationsRepository;
     _overseerrClient         = overseerrClient;
     _ombiDownloadClient      = ombiDownloadClient;
     _sonarrDownloadClient    = radarrDownloadClient;
 }
        public async Task <IActionResult> TestOverseerrSettings([FromBody] TestOverseerrSettingsModel model)
        {
            try
            {
                await OverseerrClient.TestConnectionAsync(_httpClientFactory.CreateClient(), _logger, new RequestrrBot.DownloadClients.Overseerr.OverseerrSettings
                {
                    ApiKey   = model.ApiKey.Trim(),
                    Hostname = model.Hostname.Trim(),
                    Port     = model.Port,
                    UseSSL   = model.UseSSL,
                    Version  = model.Version,
                });

                return(Ok(new { ok = true }));
            }
            catch (System.Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
Exemple #6
0
        public async Task <ActionResult <SonarrServiceSettings> > GetOverseerrSonarrServiceSettings([FromBody] TestOverseerrSettingsModel model)
        {
            try
            {
                var sonarrServiceSettings = await OverseerrClient.GetSonarrServiceSettingsAsync(_httpClientFactory.CreateClient(), _logger, new RequestrrBot.DownloadClients.Overseerr.OverseerrTestSettings
                {
                    ApiKey           = model.ApiKey.Trim(),
                    Hostname         = model.Hostname.Trim(),
                    Port             = model.Port,
                    UseSSL           = model.UseSSL,
                    DefaultApiUserId = model.DefaultApiUserID,
                    Version          = model.Version,
                });

                return(sonarrServiceSettings);
            }
            catch (System.Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }