web/queue: add remuxing progress & general improvements

and a bunch of other stuff:
- size and percentage in queue
- indeterminate progress bar
- if libav wasm freezes, the worker kill itself
- cleaner states
- cleaner props
This commit is contained in:
wukko
2025-01-25 01:25:53 +06:00
parent c4c47bdc27
commit 44a99bdb3a
12 changed files with 117 additions and 53 deletions

View File

@@ -26,7 +26,7 @@
$: queueLength = Object.keys($queue).length;
$: completedQueueItems = queueItems.filter(([id, item]) => {
return item.state === "done"
return item.state === "done";
}).length;
// TODO: toggle this only when progress is unknown
@@ -42,7 +42,11 @@
</script>
<div id="processing-queue" class:expanded>
<ProcessingStatus progress={(completedQueueItems / queueLength) * 100} {indeterminate} expandAction={popover?.showPopover} />
<ProcessingStatus
progress={(completedQueueItems / queueLength) * 100}
{indeterminate}
expandAction={popover?.showPopover}
/>
<PopoverContainer
bind:this={popover}
@@ -71,10 +75,10 @@
{#each queueItems as [id, item]}
<ProcessingQueueItem
{id}
mediaType={item.mediaType}
filename={item.filename}
state={item.state}
resultFile={item.state === "done" ? item.resultFile : undefined}
info={item}
runningWorker={
item.state === "running" ? $currentTasks[item.runningWorker] : undefined
}
/>
{/each}
{#if queueLength === 0}