diff --git a/allstarr/Services/Jellyfin/JellyfinProxyService.cs b/allstarr/Services/Jellyfin/JellyfinProxyService.cs index 447ffdb..d866103 100644 --- a/allstarr/Services/Jellyfin/JellyfinProxyService.cs +++ b/allstarr/Services/Jellyfin/JellyfinProxyService.cs @@ -256,15 +256,14 @@ public class JellyfinProxyService using var request = new HttpRequestMessage(HttpMethod.Post, url); - // Create content from body string - if (!string.IsNullOrEmpty(body)) + // Create content from body string - ALWAYS set content even if empty + // Jellyfin expects a body for POST requests, even if it's "{}" + var bodyToSend = string.IsNullOrWhiteSpace(body) ? "{}" : body; + request.Content = new StringContent(bodyToSend, System.Text.Encoding.UTF8, "application/json"); + + if (string.IsNullOrWhiteSpace(body)) { - request.Content = new StringContent(body, System.Text.Encoding.UTF8, "application/json"); - _logger.LogDebug("POST body length: {Length} bytes", body.Length); - } - else - { - _logger.LogWarning("POST body is empty for {Url}", url); + _logger.LogWarning("POST body was empty for {Url}, sending empty JSON object", url); } bool authHeaderAdded = false; @@ -312,12 +311,12 @@ public class JellyfinProxyService } else { - _logger.LogInformation("POST to Jellyfin: {Url}, body length: {Length} bytes", url, body.Length); + _logger.LogInformation("POST to Jellyfin: {Url}, body length: {Length} bytes", url, bodyToSend.Length); // Log body content for playback endpoints to debug if (endpoint.Contains("Playing", StringComparison.OrdinalIgnoreCase)) { - _logger.LogInformation("Sending body to Jellyfin: {Body}", body); + _logger.LogInformation("Sending body to Jellyfin: {Body}", bodyToSend); } }