Example #1
0
        public async Task <IActionResult> SaveAsync([FromBody] SaveRadarrSettingsModel model)
        {
            var movieSettings = new MoviesSettings
            {
                Client  = DownloadClient.Radarr,
                Command = model.Command.Trim()
            };

            var radarrSetting = new RadarrSettings
            {
                Hostname             = model.Hostname.Trim(),
                ApiKey               = model.ApiKey.Trim(),
                Port                 = model.Port,
                MoviePath            = model.MoviePath,
                MovieProfile         = model.MovieProfile,
                MovieMinAvailability = model.MovieMinAvailability,
                MovieTags            = model.MovieTags ?? Array.Empty <int>(),
                AnimePath            = model.AnimePath,
                AnimeProfile         = model.AnimeProfile,
                AnimeMinAvailability = model.AnimeMinAvailability,
                AnimeTags            = model.AnimeTags ?? Array.Empty <int>(),
                UseSSL               = model.UseSSL,
                Version              = model.Version
            };

            DownloadClientsSettingsRepository.SetRadarr(movieSettings, radarrSetting);

            return(Ok(new { ok = true }));
        }
        public async Task <IActionResult> SaveAsync([FromBody] SaveSonarrSettingsModel model)
        {
            var tvShowsSettings = new TvShowsSettings
            {
                Client  = DownloadClient.Sonarr,
                Command = model.Command.Trim()
            };

            var sonarrSetting = new SonarrSettings
            {
                Hostname              = model.Hostname.Trim(),
                Port                  = model.Port,
                ApiKey                = model.ApiKey.Trim(),
                TvPath                = model.TvPath,
                TvProfile             = model.TvProfile,
                TvTags                = model.TvTags ?? Array.Empty <int>(),
                TvLanguage            = model.TvLanguage,
                TvUseSeasonFolders    = model.TvUseSeasonFolders,
                AnimePath             = model.AnimePath,
                AnimeProfile          = model.AnimeProfile,
                AnimeTags             = model.AnimeTags ?? Array.Empty <int>(),
                AnimeLanguage         = model.AnimeLanguage,
                AnimeUseSeasonFolders = model.AnimeUseSeasonFolders,
                UseSSL                = model.UseSSL,
                Version               = model.Version
            };

            DownloadClientsSettingsRepository.SetSonarr(tvShowsSettings, sonarrSetting);

            return(Ok(new { ok = true }));
        }
        public async Task <IActionResult> SaveTvShowsAsync([FromBody] SaveOmbiSettingsModel model)
        {
            var tvShowsSettings = new TvShowsSettings
            {
                Client  = DownloadClient.Ombi,
                Command = model.Command.Trim(),
            };

            var ombiSettings = ConvertToOmbiSettings(model);

            DownloadClientsSettingsRepository.SetOmbi(tvShowsSettings, ombiSettings);

            return(Ok(new { ok = true }));
        }
Example #4
0
 public async Task <IActionResult> SaveAsync()
 {
     _tvShowsSettings.Client = DownloadClient.Disabled;
     DownloadClientsSettingsRepository.SetDisabledClient(_tvShowsSettings);
     return(Ok(new { ok = true }));
 }