fix: stop log incorrectly (#1185)

* fix: stop log incorrectly

* prevent start if already playing
This commit is contained in:
Alex Christoffer Rasmussen
2024-08-27 13:09:39 +02:00
committed by GitHub
parent db5fbd8019
commit e20cd87673
2 changed files with 5 additions and 5 deletions
@@ -512,8 +512,8 @@ class RuntimeService {
return;
}
this.eventTimer?.pause();
const newState = state.timer.playback;
logger.info(LogOrigin.Playback, `Play Mode ${newState.toUpperCase()}`);
const newState = runtimeState.getState();
logger.info(LogOrigin.Playback, `Play Mode ${newState.timer.playback.toUpperCase()}`);
process.nextTick(() => {
integrationService.dispatch(TimerLifeCycle.onPause);
});
@@ -531,8 +531,8 @@ class RuntimeService {
}
const didStop = this.eventTimer?.stop();
if (didStop) {
const newState = state.timer.playback;
logger.info(LogOrigin.Playback, `Play Mode ${newState.toUpperCase()}`);
const newState = runtimeState.getState();
logger.info(LogOrigin.Playback, `Play Mode ${newState.timer.playback.toUpperCase()}`);
process.nextTick(() => {
integrationService.dispatch(TimerLifeCycle.onStop);
});
@@ -5,7 +5,7 @@ import { Playback, TimerPhase } from 'ontime-types';
*/
export function validatePlayback(currentPlayback: Playback, timerPhase: TimerPhase) {
return {
start: currentPlayback !== Playback.Stop,
start: currentPlayback !== Playback.Stop && currentPlayback !== Playback.Play,
pause: currentPlayback === Playback.Play,
roll: currentPlayback !== Playback.Roll && timerPhase !== TimerPhase.Overtime,
stop: currentPlayback !== Playback.Stop,