From b43d49a6961110feedc882e8e9f2b37c8b94063a Mon Sep 17 00:00:00 2001 From: tidusjar Date: Thu, 10 Feb 2022 18:55:03 +0000 Subject: [PATCH] feat: updated radarr settings API to support 4k --- .../Settings/Models/External/RadarrSettings.cs | 11 +++++++++++ src/Ombi/Controllers/V1/SettingsController.cs | 14 ++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/Ombi.Settings/Settings/Models/External/RadarrSettings.cs b/src/Ombi.Settings/Settings/Models/External/RadarrSettings.cs index b074e28d6..1b3e0982f 100644 --- a/src/Ombi.Settings/Settings/Models/External/RadarrSettings.cs +++ b/src/Ombi.Settings/Settings/Models/External/RadarrSettings.cs @@ -10,4 +10,15 @@ public string MinimumAvailability { get; set; } public bool ScanForAvailability { get; set; } } + + public class Radarr4KSettings : RadarrSettings + { + // no additional properties needed + } + + public class RadarrCombinedModel + { + public RadarrSettings Radarr { get; set; } + public Radarr4KSettings Radarr4K { get; set; } + } } \ No newline at end of file diff --git a/src/Ombi/Controllers/V1/SettingsController.cs b/src/Ombi/Controllers/V1/SettingsController.cs index fcd4bb1a4..ff4dea913 100644 --- a/src/Ombi/Controllers/V1/SettingsController.cs +++ b/src/Ombi/Controllers/V1/SettingsController.cs @@ -403,9 +403,13 @@ namespace Ombi.Controllers.V1 /// /// [HttpGet("radarr")] - public async Task RadarrSettings() + public async Task RadarrSettings() { - return await Get(); + return new RadarrCombinedModel + { + Radarr = await Get(), + Radarr4K = await Get(), + }; } /// @@ -474,9 +478,11 @@ namespace Ombi.Controllers.V1 /// The settings. /// [HttpPost("radarr")] - public async Task RadarrSettings([FromBody]RadarrSettings settings) + public async Task RadarrSettings([FromBody]RadarrCombinedModel settings) { - var result = await Save(settings); + var radarrResult = await Save(settings.Radarr); + var radarr4kResult = await Save(settings.Radarr4K); + var result = radarr4kResult && radarrResult; if (result) { _cache.Remove(CacheKeys.RadarrRootProfiles);