Skip to content

Commit

Permalink
[+] Multiple elapsed
Browse files Browse the repository at this point in the history
  • Loading branch information
hykilpikonna committed Feb 11, 2024
1 parent 8b02232 commit c800a02
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/lib/Progress.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
text: string
chunks: Chunk[]
},
elapsed: number
elapsed: number[]
elapsedStr: string
}
onMount(() => {
Expand All @@ -29,7 +30,11 @@
if (data.done) {
isDone = true;
result = (await fetch(`${HOST}/result/${id}.json`).then(res => res.json()));
const tmp = (await fetch(`${HOST}/result/${id}.json`).then(res => res.json()));
if (typeof tmp.elapsed === 'number') {
tmp.elapsed = [result.elapsed, 0];
}
result = tmp;
console.log(result)
await downloadResults();
} else {
Expand All @@ -56,7 +61,7 @@
<main>
<h1>Transcription Progress</h1>
{#if isDone && result}
<p>Transcription complete ({result.elapsed.toFixed(1)}s). Your file will download shortly.</p>
<p>Transcription complete ({result.elapsed[0].toFixed(1)}s + {result.elapsed[1].toFixed(1)}s). Your file will download shortly.</p>
<a href={`${HOST}/result/${id}.txt`} download>Download</a>
<div class="chunks">
{#each result.output.chunks as chunk}
Expand Down

0 comments on commit c800a02

Please sign in to comment.