Skip to content

Commit

Permalink
Fix queue last song loop issue
Browse files Browse the repository at this point in the history
  • Loading branch information
P-man2976 committed Sep 15, 2023
1 parent 5fd6b39 commit c001a18
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/store/playback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,11 +427,9 @@ const playbackModel: PlaybackModel = {
}
while (count > 0) {
const hasQ = h.getState().queue.length > 0;
const hasPlaylist =
h.getState().playlistQueue.length +
h.getState().playedPlaylistQueue.length >
0;
const isRepeatOne = h.getState().repeatMode === "repeat-one";
const hasPlaylist = h.getState().playlistQueue.length > 0;
const hasPlayedPlaylist = h.getState().playedPlaylistQueue.length > 0;
const repeatMode = h.getState().repeatMode;
const playlistIsRadio = h
.getState()
.currentPlaylist?.type.startsWith("radio");
Expand All @@ -440,10 +438,12 @@ const playbackModel: PlaybackModel = {
let src: "queue" | "playlist" | "repeat-one" | "radio" | undefined;
if (hasQ) {
src = "queue";
} else {
if (hasPlaylist) {
src = playlistIsRadio ? "radio" : "playlist";
} else if (isRepeatOne) src = "repeat-one";
} else if (hasPlaylist) {
src = playlistIsRadio ? "radio" : "playlist";
} else if (hasPlayedPlaylist) {
src = repeatMode === "repeat" ? "playlist" : undefined;
} else if (repeatMode === "repeat-one") {
src = repeatMode;
}

// console.log("considering next song from", src);
Expand Down

0 comments on commit c001a18

Please sign in to comment.