|
|
@@ -117,11 +117,6 @@ async function fetchLibrary() {
|
|
|
renderAlbumDetail(state.activeAlbumPath);
|
|
|
}
|
|
|
|
|
|
- if (!state.currentQueue.length) {
|
|
|
- state.currentQueue = [...state.library.all_tracks];
|
|
|
- renderQueue();
|
|
|
- }
|
|
|
-
|
|
|
startFeaturedCarousel();
|
|
|
}
|
|
|
|
|
|
@@ -454,6 +449,11 @@ function renderQueue() {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+function clearQueue() {
|
|
|
+ state.currentQueue = [];
|
|
|
+ clearCurrentTrack();
|
|
|
+}
|
|
|
+
|
|
|
function renderPlaylists() {
|
|
|
const container = document.getElementById("playlistList");
|
|
|
container.innerHTML = "";
|
|
|
@@ -522,7 +522,6 @@ function renderAlbumMenu() {
|
|
|
button.onclick = () => {
|
|
|
setCurrentFolder(album.path);
|
|
|
renderAlbumDetail(album.path);
|
|
|
- startQueue(album.tracks, 0);
|
|
|
toggleAlbumMenu(false);
|
|
|
};
|
|
|
container.appendChild(button);
|
|
|
@@ -720,6 +719,11 @@ document.getElementById("backHomeBtn").onclick = () => {
|
|
|
scrollToPageTop();
|
|
|
};
|
|
|
document.getElementById("saveQueueBtn").onclick = () => renderQueue();
|
|
|
+document.getElementById("clearQueueBtn").onclick = () => {
|
|
|
+ if (!state.currentQueue.length) return;
|
|
|
+ showIconToast("清空队列");
|
|
|
+ clearQueue();
|
|
|
+};
|
|
|
document.getElementById("playModeBtn").onclick = () => {
|
|
|
const modes = ["shuffle", "one", "list", "once"];
|
|
|
const nextIndex = (modes.indexOf(state.playMode) + 1) % modes.length;
|