From 52760e0908fa9852ed8a770f1916bb582eb8c8b4 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Mon, 15 Aug 2022 13:39:24 -0700 Subject: [PATCH] Don't replace private values that haven't been set --- src/Sonarr.Http/ClientSchema/SchemaBuilder.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Sonarr.Http/ClientSchema/SchemaBuilder.cs b/src/Sonarr.Http/ClientSchema/SchemaBuilder.cs index a45253f95..a82b5a557 100644 --- a/src/Sonarr.Http/ClientSchema/SchemaBuilder.cs +++ b/src/Sonarr.Http/ClientSchema/SchemaBuilder.cs @@ -27,15 +27,13 @@ namespace Sonarr.Http.ClientSchema foreach (var mapping in mappings) { var field = mapping.Field.Clone(); + field.Value = mapping.GetterFunc(model); - if (field.Privacy == PrivacyLevel.ApiKey || field.Privacy == PrivacyLevel.Password) + if (field.Value != null && !field.Value.Equals(string.Empty) && + (field.Privacy == PrivacyLevel.ApiKey || field.Privacy == PrivacyLevel.Password)) { field.Value = PRIVATE_VALUE; } - else - { - field.Value = mapping.GetterFunc(model); - } result.Add(field); }