Fix filteredTrackCount to always reflect filtered data in Albums/Artists views
Removed the length check conditions for albums and artists views so the counter always calculates from the filtered data, even when the result is 0. Now when network folders or downloads are hidden: - Albums view: Shows 0 tracks if no albums are visible - Artists view: Shows 0 tracks if no artists are visible - Tracks view: Shows actual filtered track count This ensures the counter is always reactive to filter changes.
This commit is contained in:
1 parent
8dcfeb7f70
commit
225455bd50
1 file changed
+3
-3
@@ -190,14 +190,14 @@
|
||||
return tracks.length;
|
||||
}
|
||||
// When in albums view, calculate from filtered albums
|
||||
if (activeTab === 'albums' && albums.length > 0) {
|
||||
if (activeTab === 'albums') {
|
||||
return albums.reduce((sum, album) => sum + album.track_count, 0);
|
||||
}
|
||||
// When in artists view, calculate from filtered artists
|
||||
if (activeTab === 'artists' && artists.length > 0) {
|
||||
if (activeTab === 'artists') {
|
||||
return artists.reduce((sum, artist) => sum + artist.track_count, 0);
|
||||
}
|
||||
// Fallback to stats if available
|
||||
// Fallback for tracks view when no search results
|
||||
return stats ? stats.track_count : 0;
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user