Import PDF/EPUB

{#if pendingImport}

Review Import

Title
{pendingImport.title}
{#if pendingImport.author}
Author
{pendingImport.author}
{/if} {#if pendingImport.genres}
Genres
{pendingImport.genres}
{/if}
Status
{pendingImport.bookStatus}
File
{pendingImport.file.name}
Size
{(pendingImport.file.size / 1024 / 1024).toFixed(2)} MB
{#if pendingImport.preview.chapters > 0}
Detected chapters
{pendingImport.preview.chapters}
{/if}
{#if pendingImport.preview.firstLines?.length}

First lines preview:

{#each pendingImport.preview.firstLines as line}

{line}

{/each}
{/if}
{:else}
{ e.preventDefault(); analyzeFile(); }} class="p-6 bg-(--color-surface-2) rounded-lg space-y-4" >
{#if error}

{error}

{/if}

Detects chapter structure before committing.

{/if} {#if showAiPanel && aiSlug}

AI Tasks for {aiTitle || aiSlug}

Run AI tasks on the imported book to enrich it:

{/if}

Import Tasks

{#if loading}

Loading…

{:else if tasks.length === 0}

No import tasks yet.

{:else}
{#each tasks as task} {/each}
Title Type Status Chapters Started AI
{task.title}
{task.slug}
{#if task.error_message}
{task.error_message}
{/if}
{task.file_type} {task.status} {task.chapters_done}/{task.chapters_total} {formatDate(task.started)} {#if task.status === 'done'} {/if}
{/if}