Fix update media end time

This commit is contained in:
Rafostar
2020-10-23 10:26:11 +02:00
parent e7a39d6af8
commit 576440faff
4 changed files with 21 additions and 17 deletions

View File

@@ -145,15 +145,16 @@ class ClapperRevealerTop extends CustomRevealer
setTimes(currTime, endTime)
{
let now = currTime.format(this.timeFormat);
let end = `Ends at: ${endTime.format(this.timeFormat)}`;
let end = endTime.format(this.timeFormat);
let endText = `Ends at: ${end}`;
this.currentTime.set_label(now);
this.endTime.set_label(end);
this.endTime.set_label(endText);
/* Make sure that next timeout is always run after clock changes,
* by delaying it for additional few milliseconds */
let nextUpdate = 60002 - parseInt(currTime.get_seconds() * 1000);
debug(`updated current time: ${now}`);
debug(`updated current time: ${now}, ends at: ${end}`);
return nextUpdate;
}