Re-scheduling currently playing item now stops currnet playback, and re-schedules a clone. Allowing for DB-Friendly schedule2scrub functionality.

This commit is contained in:
rainbow napkin 2025-09-09 08:19:46 -04:00
parent 92659929b9
commit 9eeed591ad
4 changed files with 112 additions and 58 deletions

View file

@ -956,16 +956,25 @@ class queuePanel extends panelObj{
//Get current start time
const start = this.dateByOffset(target.offsetTop);
const end = new Date(start.getTime() + (target.dataset['duration'] * 1000));
//Position timetip
timetip.moveToMouse(event);
//Inject timetip label
//Normally wouldn't do innerHTML but these values are calculated serverside and it saves us making a <br> element
timetip.tooltip.innerHTML = [
//Normally wouldn't do innerHTML but these values are calculated serverside and it saves us making a <br> dom node
let timetipContents = [
`Start Time: ${utils.ux.timeStringFromDate(start, true)}`,
`End Time: ${utils.ux.timeStringFromDate(new Date(start.getTime() + (target.dataset['duration'] * 1000)), true)}`
].join('<br>');
`End Time: ${utils.ux.timeStringFromDate(end, true)}`
];
//If the current time is after the start date, but before the end (we're scheduling to start now)
if(start.getTime() < date.getTime() && end.getTime() > date.getTime()){
//Add start timestamp to item
timetipContents.push(`Start Timestamp: ${utils.ux.humieFriendlyDuration((date.getTime() - start.getTime()) / 1000, true)}`);
}
//Inject timetip label
timetip.tooltip.innerHTML = timetipContents.join('<br>')
//Calculate offset from rest of window
const windowOffset = this.queueContainer.offsetTop + this.ownerDoc.defaultView.scrollY;