From 4229924f615920a2332f55bd3f67c62008594bd2 Mon Sep 17 00:00:00 2001 From: Josh Patra Date: Tue, 3 Feb 2026 20:04:10 -0500 Subject: [PATCH] Fix bitrate showing 0K for favorited songs and browse views - Ensure MediaSources field is included when proxying browse requests - Applies to /Users/{userId}/Items (favorites, recently played, etc) - Jellyfin doesn't include MediaSources by default, must be requested - Now bitrate info shows correctly in all browse contexts --- allstarr/Controllers/JellyfinController.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/allstarr/Controllers/JellyfinController.cs b/allstarr/Controllers/JellyfinController.cs index 8cfecb6..d46e972 100644 --- a/allstarr/Controllers/JellyfinController.cs +++ b/allstarr/Controllers/JellyfinController.cs @@ -123,10 +123,23 @@ public class JellyfinController : ControllerBase // Build the full endpoint path with query string var endpoint = userId != null ? $"Users/{userId}/Items" : "Items"; - if (Request.QueryString.HasValue) + + // Ensure MediaSources is included in Fields parameter for bitrate info + var queryString = Request.QueryString.Value ?? ""; + if (!queryString.Contains("Fields=", StringComparison.OrdinalIgnoreCase)) { - endpoint = $"{endpoint}{Request.QueryString.Value}"; + // No Fields parameter, add MediaSources + queryString = string.IsNullOrEmpty(queryString) + ? "?Fields=MediaSources" + : $"{queryString}&Fields=MediaSources"; } + else if (!queryString.Contains("MediaSources", StringComparison.OrdinalIgnoreCase)) + { + // Fields parameter exists but doesn't include MediaSources, append it + queryString = $"{queryString},MediaSources"; + } + + endpoint = $"{endpoint}{queryString}"; var (browseResult, statusCode) = await _proxyService.GetJsonAsync(endpoint, null, Request.Headers);