From cef836da43a21c2e59e4554d9493bd15f736709e Mon Sep 17 00:00:00 2001 From: Josh Patra Date: Sun, 1 Feb 2026 12:05:45 -0500 Subject: [PATCH] Fix Spotify playlist ChildCount in SearchItems endpoint The playlist list was going through SearchItems (not ProxyRequest), so UpdateSpotifyPlaylistCounts was never called. Now updates counts in both: - SearchItems when browsing playlists (no search term) - ProxyRequest for other playlist list requests This fixes playlists showing 0 tracks when they should show the count of missing tracks available. --- allstarr/Controllers/JellyfinController.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/allstarr/Controllers/JellyfinController.cs b/allstarr/Controllers/JellyfinController.cs index 731b5d2..8cb5348 100644 --- a/allstarr/Controllers/JellyfinController.cs +++ b/allstarr/Controllers/JellyfinController.cs @@ -121,6 +121,13 @@ public class JellyfinController : ControllerBase return Unauthorized(new { error = "Authentication required" }); } + // Update Spotify playlist counts if enabled and response contains playlists + if (_spotifySettings.Enabled && browseResult.RootElement.TryGetProperty("Items", out var _)) + { + _logger.LogInformation("Browse result has Items, checking for Spotify playlists to update counts"); + browseResult = await UpdateSpotifyPlaylistCounts(browseResult); + } + var result = JsonSerializer.Deserialize(browseResult.RootElement.GetRawText()); if (_logger.IsEnabled(LogLevel.Debug)) {