diff --git a/frontend/src/lib/components/layout/upload-tray.svelte b/frontend/src/lib/components/layout/upload-tray.svelte index 9a27cc0..5835ecf 100644 --- a/frontend/src/lib/components/layout/upload-tray.svelte +++ b/frontend/src/lib/components/layout/upload-tray.svelte @@ -118,7 +118,13 @@ {job.error} {:else if duplicates.length > 0} - + + {#if target} {duplicateNote(duplicates)} {/if} - - - {#if job.status === 'skipped' && !queue.active} - - {/if} {:else} diff --git a/frontend/src/lib/state/upload-queue.svelte.ts b/frontend/src/lib/state/upload-queue.svelte.ts index c67db47..3b36a8a 100644 --- a/frontend/src/lib/state/upload-queue.svelte.ts +++ b/frontend/src/lib/state/upload-queue.svelte.ts @@ -21,8 +21,6 @@ export interface UploadJob { * and still carries these, since the reader asked for those files too. */ duplicates?: DuplicateFile[]; - /** Send this one again with `allow_duplicates`, from "Add anyway". */ - force?: boolean; } export interface UploadSummary { @@ -174,27 +172,6 @@ export class UploadQueueState { void this.#run(); } - /** - * Sends a job again, telling the server to store it even though it matched. - * - * The hash samples a small part of the file, so a match is strong evidence - * rather than proof; this is how someone who knows better overrules it. - */ - addAnyway(id: string) { - this.jobs = this.jobs.map((job) => - job.id === id - ? { - ...job, - status: 'queued' as UploadStatus, - force: true, - duplicates: undefined, - error: undefined - } - : job - ); - void this.#run(); - } - async #run(onFinished?: (summary: UploadSummary) => void) { if (this.#running) return; this.#running = true; @@ -217,14 +194,10 @@ export class UploadQueueState { const body = new FormData(); for (const file of job.files) body.append('files', file); - const query = - `library_id=${encodeURIComponent(String(job.libraryId))}` + - (job.force ? '&allow_duplicates=true' : ''); - - const response = await fetch(`/api/books/fromFiles?${query}`, { - method: 'POST', - body - }); + const response = await fetch( + `/api/books/fromFiles?library_id=${encodeURIComponent(String(job.libraryId))}`, + { method: 'POST', body } + ); if (!response.ok) throw new Error(`The server returned ${response.status}`);