avoid double-tracklisting

This commit is contained in:
Marks Polakovs 2020-04-13 21:29:43 +02:00
parent 657861b5e2
commit 5138e0f8a1

View file

@ -525,7 +525,11 @@ export const play = (player: number): AppThunk => async (
if (state.loadedItem && "album" in state.loadedItem) { if (state.loadedItem && "album" in state.loadedItem) {
//track //track
console.log("potentially tracklisting", state.loadedItem); 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");
}
} }
}; };