Fix played status in webstudio
This commit is contained in:
parent
a6144b2eab
commit
1e53edea2c
1 changed files with 18 additions and 17 deletions
|
@ -260,21 +260,25 @@ export const {
|
||||||
|
|
||||||
export const setItemPlayed = (
|
export const setItemPlayed = (
|
||||||
itemid: string,
|
itemid: string,
|
||||||
played: boolean,
|
played: boolean
|
||||||
player: number | null = null
|
|
||||||
): AppThunk => async (dispatch, getState) => {
|
): AppThunk => async (dispatch, getState) => {
|
||||||
|
// The server handles marking things played
|
||||||
|
// TODO: Add support in BAPSicle for marking things played
|
||||||
|
if (process.env.REACT_APP_BAPSICLE_INTERFACE) {
|
||||||
if (played) {
|
if (played) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var weight = -1;
|
var weight = -1;
|
||||||
|
var player = null;
|
||||||
|
|
||||||
if (itemid) {
|
if (itemid) {
|
||||||
const idx = getState().showplan.plan!.findIndex(
|
const idx = getState().showplan.plan!.findIndex(
|
||||||
(x) => itemId(x) === itemid
|
(x) => itemId(x) === itemid
|
||||||
);
|
);
|
||||||
weight = getState().showplan.plan![idx].weight;
|
weight = getState().showplan.plan![idx].weight;
|
||||||
|
player = getState().showplan.plan![idx].channel;
|
||||||
}
|
}
|
||||||
if (process.env.REACT_APP_BAPSICLE_INTERFACE) {
|
|
||||||
if (player) {
|
if (player) {
|
||||||
sendBAPSicleChannel({
|
sendBAPSicleChannel({
|
||||||
channel: player,
|
channel: player,
|
||||||
|
@ -288,11 +292,8 @@ export const setItemPlayed = (
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
dispatch(
|
|
||||||
showplan.actions.setItemPlayed({ itemId: itemid, played: played })
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
dispatch(showplan.actions.setItemPlayed({ itemId: itemid, played: played }));
|
||||||
};
|
};
|
||||||
|
|
||||||
export const moveItem = (
|
export const moveItem = (
|
||||||
|
|
Loading…
Reference in a new issue