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

@@ -10,9 +10,9 @@ const currentTasks = readable<CobaltCurrentTasks>(
(_, _update) => { update = _update }
);
export function addWorkerToQueue(item: CobaltCurrentTaskItem) {
export function addWorkerToQueue(workerId: string, item: CobaltCurrentTaskItem) {
update(tasks => {
tasks[item.id] = item;
tasks[workerId] = item;
return tasks;
});
}
@@ -24,10 +24,10 @@ export function removeWorkerFromQueue(id: string) {
});
}
export function updateWorkerProgress(id: string, progress: CobaltWorkerProgress) {
update(tasks => {
tasks[id].progress = progress;
return tasks;
export function updateWorkerProgress(workerId: string, progress: CobaltWorkerProgress) {
update(allTasks => {
allTasks[workerId].progress = progress;
return allTasks;
});
}