From bcb8afadf8a2c322e549e6adc3b13427514ccc0d Mon Sep 17 00:00:00 2001 From: Bogdan Date: Tue, 8 Aug 2023 18:26:09 +0300 Subject: [PATCH] New: Add Content Summary for requests to apps --- src/NzbDrone.Core/Applications/Lidarr/LidarrV1Proxy.cs | 3 +++ src/NzbDrone.Core/Applications/Radarr/RadarrV3Proxy.cs | 3 +++ src/NzbDrone.Core/Applications/Readarr/ReadarrV1Proxy.cs | 3 +++ src/NzbDrone.Core/Applications/Sonarr/SonarrV3Proxy.cs | 3 +++ src/NzbDrone.Core/Applications/Whisparr/WhisparrV3Proxy.cs | 3 +++ 5 files changed, 15 insertions(+) diff --git a/src/NzbDrone.Core/Applications/Lidarr/LidarrV1Proxy.cs b/src/NzbDrone.Core/Applications/Lidarr/LidarrV1Proxy.cs index 010619216..9b7f37685 100644 --- a/src/NzbDrone.Core/Applications/Lidarr/LidarrV1Proxy.cs +++ b/src/NzbDrone.Core/Applications/Lidarr/LidarrV1Proxy.cs @@ -84,6 +84,7 @@ namespace NzbDrone.Core.Applications.Lidarr var request = BuildRequest(settings, $"{AppIndexerApiRoute}", HttpMethod.Post); request.SetContent(indexer.ToJson()); + request.ContentSummary = indexer.ToJson(Formatting.None); try { @@ -104,6 +105,7 @@ namespace NzbDrone.Core.Applications.Lidarr var request = BuildRequest(settings, $"{AppIndexerApiRoute}/{indexer.Id}", HttpMethod.Put); request.SetContent(indexer.ToJson()); + request.ContentSummary = indexer.ToJson(Formatting.None); try { @@ -124,6 +126,7 @@ namespace NzbDrone.Core.Applications.Lidarr var request = BuildRequest(settings, $"{AppIndexerApiRoute}/test", HttpMethod.Post); request.SetContent(indexer.ToJson()); + request.ContentSummary = indexer.ToJson(Formatting.None); var applicationVersion = _httpClient.Post(request).Headers.GetSingleValue("X-Application-Version"); diff --git a/src/NzbDrone.Core/Applications/Radarr/RadarrV3Proxy.cs b/src/NzbDrone.Core/Applications/Radarr/RadarrV3Proxy.cs index aa5204f68..e74baad21 100644 --- a/src/NzbDrone.Core/Applications/Radarr/RadarrV3Proxy.cs +++ b/src/NzbDrone.Core/Applications/Radarr/RadarrV3Proxy.cs @@ -85,6 +85,7 @@ namespace NzbDrone.Core.Applications.Radarr var request = BuildRequest(settings, $"{AppIndexerApiRoute}", HttpMethod.Post); request.SetContent(indexer.ToJson()); + request.ContentSummary = indexer.ToJson(Formatting.None); try { @@ -105,6 +106,7 @@ namespace NzbDrone.Core.Applications.Radarr var request = BuildRequest(settings, $"{AppIndexerApiRoute}/{indexer.Id}", HttpMethod.Put); request.SetContent(indexer.ToJson()); + request.ContentSummary = indexer.ToJson(Formatting.None); try { @@ -125,6 +127,7 @@ namespace NzbDrone.Core.Applications.Radarr var request = BuildRequest(settings, $"{AppIndexerApiRoute}/test", HttpMethod.Post); request.SetContent(indexer.ToJson()); + request.ContentSummary = indexer.ToJson(Formatting.None); var applicationVersion = _httpClient.Post(request).Headers.GetSingleValue("X-Application-Version"); diff --git a/src/NzbDrone.Core/Applications/Readarr/ReadarrV1Proxy.cs b/src/NzbDrone.Core/Applications/Readarr/ReadarrV1Proxy.cs index ae5f5beb2..71e8a2c45 100644 --- a/src/NzbDrone.Core/Applications/Readarr/ReadarrV1Proxy.cs +++ b/src/NzbDrone.Core/Applications/Readarr/ReadarrV1Proxy.cs @@ -81,6 +81,7 @@ namespace NzbDrone.Core.Applications.Readarr var request = BuildRequest(settings, $"{AppIndexerApiRoute}", HttpMethod.Post); request.SetContent(indexer.ToJson()); + request.ContentSummary = indexer.ToJson(Formatting.None); try { @@ -101,6 +102,7 @@ namespace NzbDrone.Core.Applications.Readarr var request = BuildRequest(settings, $"{AppIndexerApiRoute}/{indexer.Id}", HttpMethod.Put); request.SetContent(indexer.ToJson()); + request.ContentSummary = indexer.ToJson(Formatting.None); try { @@ -121,6 +123,7 @@ namespace NzbDrone.Core.Applications.Readarr var request = BuildRequest(settings, $"{AppIndexerApiRoute}/test", HttpMethod.Post); request.SetContent(indexer.ToJson()); + request.ContentSummary = indexer.ToJson(Formatting.None); _httpClient.Post(request); diff --git a/src/NzbDrone.Core/Applications/Sonarr/SonarrV3Proxy.cs b/src/NzbDrone.Core/Applications/Sonarr/SonarrV3Proxy.cs index 35d4896eb..48dcea40d 100644 --- a/src/NzbDrone.Core/Applications/Sonarr/SonarrV3Proxy.cs +++ b/src/NzbDrone.Core/Applications/Sonarr/SonarrV3Proxy.cs @@ -84,6 +84,7 @@ namespace NzbDrone.Core.Applications.Sonarr var request = BuildRequest(settings, $"{AppIndexerApiRoute}", HttpMethod.Post); request.SetContent(indexer.ToJson()); + request.ContentSummary = indexer.ToJson(Formatting.None); try { @@ -104,6 +105,7 @@ namespace NzbDrone.Core.Applications.Sonarr var request = BuildRequest(settings, $"{AppIndexerApiRoute}/{indexer.Id}", HttpMethod.Put); request.SetContent(indexer.ToJson()); + request.ContentSummary = indexer.ToJson(Formatting.None); try { @@ -124,6 +126,7 @@ namespace NzbDrone.Core.Applications.Sonarr var request = BuildRequest(settings, $"{AppIndexerApiRoute}/test", HttpMethod.Post); request.SetContent(indexer.ToJson()); + request.ContentSummary = indexer.ToJson(Formatting.None); var applicationVersion = _httpClient.Post(request).Headers.GetSingleValue("X-Application-Version"); diff --git a/src/NzbDrone.Core/Applications/Whisparr/WhisparrV3Proxy.cs b/src/NzbDrone.Core/Applications/Whisparr/WhisparrV3Proxy.cs index 2d1e8a853..530005c5f 100644 --- a/src/NzbDrone.Core/Applications/Whisparr/WhisparrV3Proxy.cs +++ b/src/NzbDrone.Core/Applications/Whisparr/WhisparrV3Proxy.cs @@ -81,6 +81,7 @@ namespace NzbDrone.Core.Applications.Whisparr var request = BuildRequest(settings, $"{AppIndexerApiRoute}", HttpMethod.Post); request.SetContent(indexer.ToJson()); + request.ContentSummary = indexer.ToJson(Formatting.None); try { @@ -99,6 +100,7 @@ namespace NzbDrone.Core.Applications.Whisparr var request = BuildRequest(settings, $"{AppIndexerApiRoute}/{indexer.Id}", HttpMethod.Put); request.SetContent(indexer.ToJson()); + request.ContentSummary = indexer.ToJson(Formatting.None); try { @@ -119,6 +121,7 @@ namespace NzbDrone.Core.Applications.Whisparr var request = BuildRequest(settings, $"{AppIndexerApiRoute}/test", HttpMethod.Post); request.SetContent(indexer.ToJson()); + request.ContentSummary = indexer.ToJson(Formatting.None); _httpClient.Post(request);