A music player that connects to your cloud/distributed storage.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(facets/auto-queue): group playlists by ordered/unordered

+21 -10
+1 -1
src/facets/index.vto
··· 18 18 desc: > 19 19 Audio playback controller with an artwork display. 20 20 - url: "facets/tools/auto-queue.html.txt" 21 - title: "Tools / Auto Queue Control Panel" 21 + title: "Tools / Automatic Queue" 22 22 desc: > 23 23 Everything you need to automatically put tracks into the queue. 24 24 - url: "facets/tools/v3-import.html.txt"
+20 -9
src/facets/tools/auto-queue.html.txt
··· 87 87 88 88 // Playlist state 89 89 effect(() => { 90 - const playlists = output.playlists.collection().sort((a, b) => { 91 - a.name.localeCompare(b.name); 92 - }); 90 + const playlists = output.playlists.collection().sort((a, b) => 91 + a.name.localeCompare(b.name) 92 + ); 93 93 94 94 const currentId = scope.playlistId(); 95 + const ordered = playlists.filter((p) => !p.unordered); 96 + const unordered = playlists.filter((p) => p.unordered); 95 97 96 98 playlistSelect.innerHTML = `<option value="">All tracks</option>`; 97 99 98 - for (const playlist of playlists) { 99 - const option = document.createElement("option"); 100 - option.value = playlist.id; 101 - option.textContent = playlist.name; 102 - option.selected = playlist.id === currentId; 103 - playlistSelect.appendChild(option); 100 + for (const [label, group] of [["Ordered", ordered], ["Unordered", unordered]]) { 101 + if (group.length === 0) continue; 102 + 103 + const optgroup = document.createElement("optgroup"); 104 + optgroup.label = label; 105 + 106 + for (const playlist of group) { 107 + const option = document.createElement("option"); 108 + option.value = playlist.id; 109 + option.textContent = playlist.name; 110 + option.selected = playlist.id === currentId; 111 + optgroup.appendChild(option); 112 + } 113 + 114 + playlistSelect.appendChild(optgroup); 104 115 } 105 116 }); 106 117