From 5b0fb1a72dc95eb9fced3056b871e46f697a0e0d Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Tue, 20 Jan 2026 01:54:27 -0600 Subject: [PATCH] Fix track counter fallback to use filtered albums instead of total stats Changed the fallback case (Tracks view without search) to calculate from filtered albums instead of using stats.track_count. Now when both filters are active (network folders + downloads hidden): - Shows 0 tracks correctly instead of total count - Counter always reflects actual filtered content across all tabs --- src/lib/components/views/LocalLibraryView.svelte | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/components/views/LocalLibraryView.svelte b/src/lib/components/views/LocalLibraryView.svelte index ae5df8b84..cdc3be8bc 100644 --- a/src/lib/components/views/LocalLibraryView.svelte +++ b/src/lib/components/views/LocalLibraryView.svelte @@ -197,8 +197,9 @@ if (activeTab === 'artists') { return artists.reduce((sum, artist) => sum + artist.track_count, 0); } - // Fallback for tracks view when no search results - return stats ? stats.track_count : 0; + // Fallback for tracks view when no search results - calculate from albums + // This ensures the counter respects filters even when tracks aren't loaded + return albums.reduce((sum, album) => sum + album.track_count, 0); }); // Loading state