Usenet streaming with a WebDAV server and a SABnzbd-compatible API
C#
Fixed bug calling radarr/sonarr RefreshMonitoredDownloads.
nzbdav-dev8a44d8b90030
diff --git a/backend/Clients/RadarrSonarr/ArrClient.cs b/backend/Clients/RadarrSonarr/ArrClient.csindex f76da48f..4d54f987 100644--- a/backend/Clients/RadarrSonarr/ArrClient.cs+++ b/backend/Clients/RadarrSonarr/ArrClient.cs@@ -1,5 +1,5 @@using System.Net;-using System.Net.Http.Json;+using System.Net.Http.Headers;using System.Text.Json;using NzbWebDAV.Clients.RadarrSonarr.BaseModels;using NzbWebDAV.Config;@@ -63,7 +63,8 @@ public class ArrClient(string host, string apiKey)protected async Task<T> Post<T>(string path, object body){var request = new HttpRequestMessage(HttpMethod.Post, GetRequestUri(path));- request.Content = new StringContent(JsonSerializer.Serialize(body));+ var jsonBody = JsonSerializer.Serialize(body);+ request.Content = new StringContent(jsonBody, new MediaTypeHeaderValue("application/json"));using var response = await SendAsync(request);await using var stream = await response.Content.ReadAsStreamAsync();return await JsonSerializer.DeserializeAsync<T>(stream) ?? throw new NullReferenceException();diff --git a/backend/Queue/QueueItemProcessor.cs b/backend/Queue/QueueItemProcessor.csindex c29db63a..f96b63ec 100644--- a/backend/Queue/QueueItemProcessor.cs+++ b/backend/Queue/QueueItemProcessor.cs@@ -364,7 +364,7 @@ public class QueueItemProcessor(var downloadClients = await arrClient.GetDownloadClientsAsync().ConfigureAwait(false);if (downloadClients.All(x => x.Category != queueItem.Category)) return;var queueCount = await arrClient.GetQueueCountAsync().ConfigureAwait(false);- if (queueCount < 60) await arrClient.RefreshMonitoredDownloads().ConfigureAwait(false);+ if (queueCount < 300) await arrClient.RefreshMonitoredDownloads().ConfigureAwait(false);}catch (Exception e){