From d045b33afd43db19f4d7f9e847361a167baddd1d Mon Sep 17 00:00:00 2001 From: Josh Patra Date: Wed, 4 Feb 2026 23:35:10 -0500 Subject: [PATCH] Fix Spotify playlist track counts to include external tracks - Changed totalAvailableCount calculation to include both local and external matched tracks - Updated logging to show breakdown of local vs external tracks - This fixes Discover Weekly and other external-only playlists showing 0 tracks in clients Now playlists with all external tracks will show correct track counts in Feishin and other clients. --- allstarr/Controllers/JellyfinController.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/allstarr/Controllers/JellyfinController.cs b/allstarr/Controllers/JellyfinController.cs index 4c43812..4b8c7f1 100644 --- a/allstarr/Controllers/JellyfinController.cs +++ b/allstarr/Controllers/JellyfinController.cs @@ -2843,21 +2843,22 @@ public class JellyfinController : ControllerBase externalMatchedCount = matchedTracks.Count(t => t.MatchedSong != null && !t.MatchedSong.IsLocal); } - // Total available tracks = what's actually in Jellyfin (local + external matched) - // This is what clients should see as the track count - var totalAvailableCount = localTracksCount; + // Total available tracks = local tracks in Jellyfin + external matched tracks + // This represents what users will actually hear when playing the playlist + var totalAvailableCount = localTracksCount + externalMatchedCount; if (totalAvailableCount > 0) { // Update ChildCount to show actual available tracks itemDict["ChildCount"] = totalAvailableCount; modified = true; - _logger.LogInformation("✓ Updated ChildCount for Spotify playlist {Name} to {Total} (actual tracks in Jellyfin)", - playlistName, totalAvailableCount); + _logger.LogInformation("✓ Updated ChildCount for Spotify playlist {Name} to {Total} ({Local} local + {External} external)", + playlistName, totalAvailableCount, localTracksCount, externalMatchedCount); } else { - _logger.LogWarning("No tracks found in Jellyfin for {Name}", playlistName); + _logger.LogWarning("No tracks found for {Name} ({Local} local + {External} external = {Total} total)", + playlistName, localTracksCount, externalMatchedCount, totalAvailableCount); } } }