function readableMicroseconds(us) { const min = parseInt(us / 60_000_000); const sec = parseInt((us % 60_000_000) / 1_000_000); if (!min) { return `${sec}s`; } return `${min}m ${sec}s`; } async function main() { const response = await fetch(`/api/video-queue`); if (!response.ok) { error("something went wrong"); return; } const json = await response.json(); if (!json.ok) { error(json.error); } const queue = json.queue; document.getElementById("result").innerHTML = `

Currently processing ${queue.length} video(s)

` + `"; } main();