[bugfix]: set MPV queue when now or queue is empty

This commit is contained in:
Kendall Garner 2024-02-13 00:04:28 -08:00
parent 8de21a707c
commit e6b01d4e2b
No known key found for this signature in database
GPG Key ID: 18D2767419676C87

View File

@ -173,14 +173,12 @@ export const useHandlePlayQueueAdd = () => {
if (playerType === PlaybackType.LOCAL) { if (playerType === PlaybackType.LOCAL) {
mpvPlayer!.volume(usePlayerStore.getState().volume); mpvPlayer!.volume(usePlayerStore.getState().volume);
if (playType === Play.NEXT || playType === Play.LAST) { if (playType === Play.NOW || !hadSong) {
mpvPlayer!.setQueueNext(playerData);
}
if (playType === Play.NOW) {
mpvPlayer!.pause(); mpvPlayer!.pause();
mpvPlayer!.setQueue(playerData); mpvPlayer!.setQueue(playerData);
mpvPlayer!.play(); mpvPlayer!.play();
} else {
mpvPlayer!.setQueueNext(playerData);
} }
} }