mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-20 22:49:18 +00:00
use expectedFinish
This commit is contained in:
@@ -404,7 +404,7 @@ export class TimerService {
|
|||||||
let shouldNotify = false;
|
let shouldNotify = false;
|
||||||
if (this.playback === Playback.Roll) {
|
if (this.playback === Playback.Roll) {
|
||||||
shouldNotify = true;
|
shouldNotify = true;
|
||||||
if (skipedOutOfEvent(previousTime, this.timer.clock, this.timer.startedAt, this.timer.finishedAt)) {
|
if (skipedOutOfEvent(previousTime, this.timer.clock, this.timer.startedAt, this.timer.expectedFinish)) {
|
||||||
PlaybackService.roll();
|
PlaybackService.roll();
|
||||||
} else {
|
} else {
|
||||||
this.updateRoll();
|
this.updateRoll();
|
||||||
|
|||||||
@@ -66,11 +66,11 @@ export function getCurrent(
|
|||||||
return startedAt + duration + addedTime + pausedTime - clock;
|
return startedAt + duration + addedTime + pausedTime - clock;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function skipedOutOfEvent(previousTime: number, clock: number, startedAt: number, finishAt): boolean {
|
export function skipedOutOfEvent(previousTime: number, clock: number, startedAt: number, expectedFinish): boolean {
|
||||||
const skipTime = previousTime - clock;
|
const skipTime = previousTime - clock;
|
||||||
const hasSkipped = Math.abs(skipTime) > config.timeSkipLimit;
|
const hasSkipped = Math.abs(skipTime) > config.timeSkipLimit;
|
||||||
if (hasSkipped) {
|
if (hasSkipped) {
|
||||||
if (clock > finishAt || clock < startedAt) {
|
if (clock > expectedFinish || clock < startedAt) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// otherwise we just skipped within the event
|
// otherwise we just skipped within the event
|
||||||
|
|||||||
Reference in New Issue
Block a user