feat: add EPUB format support with spine-aware image extraction
Parse EPUB structure (container.xml → OPF → spine → XHTML) to extract images in reading order. Zero new dependencies — reuses zip + regex crates with pre-compiled regexes and per-file index cache for performance. Falls back to CBZ-style image listing when spine contains no images. Includes DB migration, API/indexer/backoffice updates. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
10
infra/migrations/0046_add_epub_format.sql
Normal file
10
infra/migrations/0046_add_epub_format.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
-- Add EPUB to allowed format values in book_files and books tables.
|
||||
-- PostgreSQL CHECK constraints are dropped+recreated (no ALTER CONSTRAINT).
|
||||
|
||||
-- book_files.format
|
||||
ALTER TABLE book_files DROP CONSTRAINT IF EXISTS book_files_format_check;
|
||||
ALTER TABLE book_files ADD CONSTRAINT book_files_format_check CHECK (format IN ('pdf', 'cbz', 'cbr', 'epub'));
|
||||
|
||||
-- books.format (denormalized column added in 0020)
|
||||
ALTER TABLE books DROP CONSTRAINT IF EXISTS books_format_check;
|
||||
ALTER TABLE books ADD CONSTRAINT books_format_check CHECK (format IN ('pdf', 'cbz', 'cbr', 'epub'));
|
||||
Reference in New Issue
Block a user