From 3337d09cf41dffcf02d1a8f9b163faa44872f8b8 Mon Sep 17 00:00:00 2001
From: vicrodh <103399283+vicrodh@users.noreply.github.com>
Date: Sat, 24 Jan 2026 17:26:55 -0600
Subject: [PATCH] Add track count sorting option to PlaylistManager
Sort playlists by total track count (Qobuz + local tracks) in descending order.
---
src/lib/components/views/PlaylistManagerView.svelte | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/lib/components/views/PlaylistManagerView.svelte b/src/lib/components/views/PlaylistManagerView.svelte
index 2f6a80824..ddb96978a 100644
--- a/src/lib/components/views/PlaylistManagerView.svelte
+++ b/src/lib/components/views/PlaylistManagerView.svelte
@@ -39,7 +39,7 @@
}
type PlaylistFilter = 'all' | 'visible' | 'hidden' | 'offline_all' | 'offline_partial' | 'offline_unavailable';
- type PlaylistSort = 'name' | 'recent' | 'playcount' | 'custom';
+ type PlaylistSort = 'name' | 'recent' | 'playcount' | 'tracks' | 'custom';
type ViewMode = 'list' | 'grid';
interface Props {
@@ -175,6 +175,12 @@
const countB = playlistStats.get(b.id)?.play_count ?? 0;
return countB - countA;
});
+ } else if (sort === 'tracks') {
+ result.sort((a, b) => {
+ const countA = getTotalTrackCount(a);
+ const countB = getTotalTrackCount(b);
+ return countB - countA;
+ });
} else if (sort === 'custom') {
result.sort((a, b) => {
const posA = playlistSettings.get(a.id)?.position ?? 999;
@@ -491,7 +497,7 @@
{#if showSortMenu}
@@ -505,6 +511,9 @@
+