Example #1
0
 private static OmbiSettingsModel Sanitize(OmbiSettingsModel model)
 {
     return(new OmbiSettingsModel
     {
         Hostname = model.Hostname.Trim(),
         ApiKey = model.ApiKey.Trim(),
         ApiUsername = model.ApiUsername.Trim(),
         Port = model.Port,
         BaseUrl = model.BaseUrl.Trim(),
         UseSSL = model.UseSSL,
         Version = model.Version
     });
 }
Example #2
0
        public async Task <IActionResult> SaveTvShowsAsync([FromBody] OmbiSettingsModel model)
        {
            var tvShowsSettings = new TvShowsSettings
            {
                Client  = DownloadClient.Ombi,
                Command = model.Command.Trim(),
            };

            var ombiSettings = Sanitize(model);

            DownloadClientsSettingsRepository.SetOmbi(tvShowsSettings, ombiSettings);

            return(Ok(new { ok = true }));
        }