From 5138e0f8a122c7c6a43985e4a9ec18519eda46e8 Mon Sep 17 00:00:00 2001 From: Marks Polakovs Date: Mon, 13 Apr 2020 21:29:43 +0200 Subject: [PATCH] avoid double-tracklisting --- src/mixer/state.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mixer/state.ts b/src/mixer/state.ts index a27ace5..b83fda7 100644 --- a/src/mixer/state.ts +++ b/src/mixer/state.ts @@ -525,7 +525,11 @@ export const play = (player: number): AppThunk => async ( if (state.loadedItem && "album" in state.loadedItem) { //track console.log("potentially tracklisting", state.loadedItem); - dispatch(BroadcastState.tracklistStart(player, state.loadedItem.trackid)); + if (getState().mixer.players[player].tracklistItemID !== -1) { + dispatch(BroadcastState.tracklistStart(player, state.loadedItem.trackid)); + } else { + console.log("not tracklisting because already tracklisted"); + } } };