Ejemplo n.º 1
0
        public DiscordSettings Provide()
        {
            dynamic settings = SettingsFile.Read();

            return(new DiscordSettings
            {
                BotToken = settings.ChatClients.Discord.BotToken,
                CommandPrefix = settings.BotClient.CommandPrefix,
                MovieDownloadClient = settings.Movies.Client,
                MovieCommand = settings.Movies.Command,
                MovieDownloadClientConfigurationHash = ComputeMovieClientConfigurationHashCode(settings),
                TvShowDownloadClient = settings.TvShows.Client,
                TvShowCommand = settings.TvShows.Command,
                TvShowDownloadClientConfigurationHash = ComputeTvClientConfigurationHashCode(settings),
                StatusMessage = settings.ChatClients.Discord.StatusMessage,
                MonitoredChannels = settings.ChatClients.Discord.MonitoredChannels.ToObject <string[]>(),
                TvShowRoles = settings.ChatClients.Discord.TvShowRoles.ToObject <string[]>(),
                MovieRoles = settings.ChatClients.Discord.MovieRoles.ToObject <string[]>(),
                ClientID = settings.ChatClients.Discord.ClientId,
                EnableRequestsThroughDirectMessages = settings.ChatClients.Discord.EnableRequestsThroughDirectMessages,
                AutomaticallyNotifyRequesters = settings.ChatClients.Discord.AutomaticallyNotifyRequesters,
                NotificationMode = settings.ChatClients.Discord.NotificationMode,
                NotificationChannels = settings.ChatClients.Discord.NotificationChannels.ToObject <string[]>(),
                AutomaticallyPurgeCommandMessages = settings.ChatClients.Discord.AutomaticallyPurgeCommandMessages,
                DisplayHelpCommandInDMs = settings.ChatClients.Discord.DisplayHelpCommandInDMs,
            });
        }
Ejemplo n.º 2
0
        public ChatClientsSettings Provide()
        {
            dynamic settings = SettingsFile.Read();

            var discordSettings = new DiscordSettings
            {
                BotToken          = (string)settings.ChatClients.Discord.BotToken,
                ClientId          = (string)settings.ChatClients.Discord.ClientId,
                StatusMessage     = (string)settings.ChatClients.Discord.StatusMessage,
                MonitoredChannels = settings.ChatClients.Discord.MonitoredChannels.ToObject <string[]>(),
                TvShowRoles       = settings.ChatClients.Discord.TvShowRoles.ToObject <string[]>(),
                MovieRoles        = settings.ChatClients.Discord.MovieRoles.ToObject <string[]>(),
                EnableRequestsThroughDirectMessages = (bool)settings.ChatClients.Discord.EnableRequestsThroughDirectMessages,
                AutomaticallyNotifyRequesters       = (bool)settings.ChatClients.Discord.AutomaticallyNotifyRequesters,
                NotificationMode     = (string)settings.ChatClients.Discord.NotificationMode,
                NotificationChannels = settings.ChatClients.Discord.NotificationChannels.ToObject <string[]>(),
                AutomaticallyPurgeCommandMessages = (bool)settings.ChatClients.Discord.AutomaticallyPurgeCommandMessages,
            };

            return(new ChatClientsSettings
            {
                Discord = discordSettings,
                Language = settings.ChatClients.Language,
            });
        }
Ejemplo n.º 3
0
        public SonarrSettings Provide()
        {
            dynamic settings = SettingsFile.Read();

            return(new SonarrSettings
            {
                Hostname = settings.DownloadClients.Sonarr.Hostname,
                BaseUrl = settings.DownloadClients.Sonarr.BaseUrl,
                Port = (int)settings.DownloadClients.Sonarr.Port,
                ApiKey = settings.DownloadClients.Sonarr.ApiKey,
                TvProfileId = settings.DownloadClients.Sonarr.TvProfileId,
                TvRootFolder = settings.DownloadClients.Sonarr.TvRootFolder,
                TvLanguageId = settings.DownloadClients.Sonarr.TvLanguageId,
                TvTags = settings.DownloadClients.Sonarr.TvTags.ToObject <int[]>(),
                TvUseSeasonFolders = settings.DownloadClients.Sonarr.TvUseSeasonFolders,
                AnimeProfileId = settings.DownloadClients.Sonarr.AnimeProfileId,
                AnimeRootFolder = settings.DownloadClients.Sonarr.AnimeRootFolder,
                AnimeLanguageId = settings.DownloadClients.Sonarr.AnimeLanguageId,
                AnimeTags = settings.DownloadClients.Sonarr.AnimeTags.ToObject <int[]>(),
                AnimeUseSeasonFolders = settings.DownloadClients.Sonarr.AnimeUseSeasonFolders,
                SearchNewRequests = settings.DownloadClients.Sonarr.SearchNewRequests,
                MonitorNewRequests = settings.DownloadClients.Sonarr.MonitorNewRequests,
                UseSSL = (bool)settings.DownloadClients.Sonarr.UseSSL,
                Version = settings.DownloadClients.Sonarr.Version,
            });
        }
Ejemplo n.º 4
0
        public BotClientSettings Provide()
        {
            dynamic settings = SettingsFile.Read();

            return(new BotClientSettings
            {
                Client = (string)settings.BotClient.Client,
            });
        }
Ejemplo n.º 5
0
        public MoviesSettings Provide()
        {
            dynamic settings = SettingsFile.Read();

            return(new MoviesSettings
            {
                Client = settings.Movies.Client,
            });
        }
Ejemplo n.º 6
0
        public TvShowsSettings Provide()
        {
            dynamic settings = SettingsFile.Read();

            return(new TvShowsSettings
            {
                Client = settings.TvShows.Client,
                Restrictions = settings.TvShows.Restrictions,
            });
        }
        public ApplicationSettings Provide()
        {
            dynamic settings = SettingsFile.Read();

            return(new ApplicationSettings
            {
                Port = (int)settings.Port,
                BaseUrl = (string)settings.BaseUrl,
                DisableAuthentication = (bool)settings.DisableAuthentication,
            });
        }
Ejemplo n.º 8
0
        public AuthenticationSettings Provide()
        {
            dynamic settings = SettingsFile.Read();

            return(new AuthenticationSettings
            {
                Username = (string)settings.Authentication.Username,
                Password = (string)settings.Authentication.Password,
                PrivateKey = (string)settings.Authentication.PrivateKey,
            });
        }
Ejemplo n.º 9
0
        public DownloadClientsSettings Provide()
        {
            dynamic settings = SettingsFile.Read();

            return(new DownloadClientsSettings
            {
                Ombi = new OmbiSettingsProvider().Provide(),
                Overseerr = new OverseerrSettingsProvider().Provide(),
                Radarr = new RadarrSettingsProvider().Provide(),
                Sonarr = new SonarrSettingsProvider().Provide(),
            });
        }
Ejemplo n.º 10
0
        public OmbiSettings Provide()
        {
            dynamic settings = SettingsFile.Read();

            return(new OmbiSettings
            {
                ApiKey = settings.DownloadClients.Ombi.ApiKey,
                ApiUsername = settings.DownloadClients.Ombi.ApiUsername,
                Hostname = settings.DownloadClients.Ombi.Hostname,
                Port = settings.DownloadClients.Ombi.Port,
                UseSSL = (bool)settings.DownloadClients.Ombi.UseSSL
            });
        }
Ejemplo n.º 11
0
        public OverseerrSettings Provide()
        {
            dynamic settings = SettingsFile.Read();

            return(new OverseerrSettings
            {
                ApiKey = settings.DownloadClients.Overseerr.ApiKey,
                DefaultApiUserID = settings.DownloadClients.Overseerr.DefaultApiUserID,
                Hostname = settings.DownloadClients.Overseerr.Hostname,
                Port = settings.DownloadClients.Overseerr.Port,
                UseSSL = (bool)settings.DownloadClients.Overseerr.UseSSL
            });
        }
Ejemplo n.º 12
0
        public OverseerrSettings Provide()
        {
            dynamic settings = SettingsFile.Read();

            return(new OverseerrSettings
            {
                ApiKey = settings.DownloadClients.Overseerr.ApiKey,
                Movies = settings.DownloadClients.Overseerr.Movies.ToObject <OverseerrMovieSettings>(),
                TvShows = settings.DownloadClients.Overseerr.TvShows.ToObject <OverseerrTvShowSettings>(),
                Hostname = settings.DownloadClients.Overseerr.Hostname,
                Port = settings.DownloadClients.Overseerr.Port,
                UseSSL = (bool)settings.DownloadClients.Overseerr.UseSSL,
                Version = settings.DownloadClients.Overseerr.Version,
            });
        }
Ejemplo n.º 13
0
        public SonarrSettings Provide()
        {
            dynamic settings = SettingsFile.Read();

            return(new SonarrSettings
            {
                Hostname = settings.DownloadClients.Sonarr.Hostname,
                BaseUrl = settings.DownloadClients.Sonarr.BaseUrl,
                Port = (int)settings.DownloadClients.Sonarr.Port,
                ApiKey = settings.DownloadClients.Sonarr.ApiKey,
                Categories = settings.DownloadClients.Sonarr.Categories.ToObject <SonarrCategory[]>(),
                SearchNewRequests = settings.DownloadClients.Sonarr.SearchNewRequests,
                MonitorNewRequests = settings.DownloadClients.Sonarr.MonitorNewRequests,
                UseSSL = (bool)settings.DownloadClients.Sonarr.UseSSL,
                Version = settings.DownloadClients.Sonarr.Version,
            });
        }
Ejemplo n.º 14
0
        public RadarrSettings Provide()
        {
            dynamic settings = SettingsFile.Read();

            return(new RadarrSettings
            {
                Hostname = settings.DownloadClients.Radarr.Hostname,
                Port = (int)settings.DownloadClients.Radarr.Port,
                ApiKey = settings.DownloadClients.Radarr.ApiKey,
                MovieProfileId = (int)settings.DownloadClients.Radarr.MovieProfileId,
                MovieRootFolder = settings.DownloadClients.Radarr.MovieRootFolder,
                MovieMinimumAvailability = settings.DownloadClients.Radarr.MovieMinimumAvailability,
                MovieTags = settings.DownloadClients.Radarr.MovieTags.ToObject <int[]>(),
                AnimeProfileId = (int)settings.DownloadClients.Radarr.AnimeProfileId,
                AnimeRootFolder = settings.DownloadClients.Radarr.AnimeRootFolder,
                AnimeMinimumAvailability = settings.DownloadClients.Radarr.AnimeMinimumAvailability,
                AnimeTags = settings.DownloadClients.Radarr.AnimeTags.ToObject <int[]>(),
                UseSSL = (bool)settings.DownloadClients.Radarr.UseSSL,
                Version = settings.DownloadClients.Radarr.Version,
            });
        }
Ejemplo n.º 15
0
        public DiscordSettings Provide()
        {
            dynamic settings = SettingsFile.Read();
            string monitoredChannels = settings.BotClient.MonitoredChannels;

            return new DiscordSettings
            {
                BotToken = settings.ChatClients.Discord.BotToken,
                CommandPrefix = settings.BotClient.CommandPrefix,
                MovieDownloadClient = settings.Movies.Client,
                MovieCommand = settings.Movies.Command,
                MovieDownloadClientConfigurationHash = ComputeMovieClientConfigurationHashCode(settings),
                TvShowDownloadClient = settings.TvShows.Client,
                TvShowCommand = settings.TvShows.Command,
                TvShowDownloadClientConfigurationHash = ComputeTvClientConfigurationHashCode(settings),
                StatusMessage = settings.ChatClients.Discord.StatusMessage,
                MonitoredChannels = monitoredChannels.Split(" ").Where(s => !string.IsNullOrWhiteSpace(s)).ToArray(),
                ClientID = settings.ChatClients.Discord.ClientId,
                EnableDirectMessageSupport = settings.ChatClients.Discord.EnableDirectMessageSupport
            };
        }