Commit Graph
179 Commits
Author SHA1 Message Date
xcashyandACX 539734a3cf feat(kobo-sync): Sync Shelves and Magic Shelves to Kobo Tags (#2236)
* feat(kobo-sync): sync shelves and magic shelves to kobo tags

* refactor(kobo-sync): replace `EntityNotFoundException` with `NoSuchElementException`, update timestamps handling, and add unit tests for `generateTags`

---------

Co-authored-by: ACX <8075870+acx10@users.noreply.github.com>
2026-02-05 13:59:08 -07:00
ACXandacx10 d38271de9c Audiobook enhancement (#2611)
* Audiobook enhancement

* Fix choppy virtual scroller with mixed audiobook/ebook cards by using uniform heights

* Fix audiobook cover regeneration for combined books and improve error messages

* Fix cover extraction when attaching audiobook files during rescan

* Set audiobookCoverUpdatedOn for cache busting when generating cover

* Add support for regenerating covers from specific book files

* Fix Continue Reading/Listening scrollers to filter by actual progress instead of primary file type

* Show ebook cover and open ebook reader in Continue Reading scroller for combined books

* Prevent read status from being downgraded when saving audiobook progress

* Fix BookCoverServiceTest to match updated regenerateCover method signature
---------

Co-authored-by: acx10 <acx10@users.noreply.github.com>
2026-02-05 13:33:08 -07:00
Ben Szabo a77cecdf21 feat(kobo-sync): add user scoped 2 way kobo sync (#2452)
* fix(kobo-sync): Kobo reading state sync by returning the device expected shape and improve management with new DTOs and timestamp normalization

- Introduced `KoboReadingStateList` and `KoboReadingStateRequest` DTOs for improved handling of reading states.
- Updated `KoboController` to utilize the new DTOs and log request bodies.
- Enhanced `KoboReadingStateService` to normalize timestamps during reading state updates and merges.
- Adjusted repository queries to include user ID for better data integrity.
- Updated tests to reflect changes in DTOs and repository interactions.

* feat(kobo-sync): Enhance Kobo reading state management with user ID integration

* feat(kobo-sync): Add JSON annotations to KoboReadingStateList for improved serialization

* refactor(kobo-sync): Update repository and service methods to enhance reading state retrieval logic

- Replaced the existing method for fetching reading states with a new query that orders results by priority and timestamps.
- Updated service classes to utilize the new repository method for improved data handling.
- Adjusted unit tests to reflect changes in repository interactions.

* Enhance KoboReadingStateService and add database migration for user_id

- Added a new column `user_id` to the `kobo_reading_state` table with a foreign key constraint referencing the `users` table.
- Updated the `KoboReadingStateService` class by adding a new method to check for blank values, improving code readability and maintainability.
2026-02-02 10:27:58 -07:00
acx10 91c0382527 refactor: rename package to org.booklore 2026-02-02 00:02:12 -07:00
acx10 b6057588f6 Fix audiobook player 2026-01-31 15:55:42 -07:00
acx10 b215dbb692 Fix tests 2026-01-29 18:18:37 -07:00
Balázs Szücs 3a4de95c8c fix(metadata-update): ensure per-book transaction isolation in bulk updates to prevent race conditions (#2536)
Refactor bulkUpdateMetadata to process each book update in its own transaction using PROPAGATION_REQUIRES_NEW, improving concurrency safety. Add BookMetadataServiceConcurrencyTest to verify correct fetching strategy and transactional behavior.

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
2026-01-29 18:00:27 -07:00
JadehawkandACX 5ad66daae6 feat(metadata) Save basic metadata to EPUB file - Bonus use Calibre Custom Columns for importing metadata. (#1879)
* feat: Add comprehensive Calibre metadata extraction system - Implemented configurable field mapping system for Calibre user_metadata - Added support for series_total custom column extraction - Pre-built mappings for ALL BookMetadata fields (20+ fields) - Added support for Set fields (tags, moods, categories, authors) - Lowercase field names with underscores (Calibre requirement) - Multiple ISBN support (ISBN-10 and ISBN-13 simultaneously) - ISBN hyphen handling (strips hyphens before validation) - Type-safe parsing (String, Integer, Float, Double, Set) - Professional logging with IDENTIFIER prefix - Added CALIBRE_FIELD_MAPPING_REFERENCE.txt documentation - Updated .gitignore and created .dockerignore for test files

* Updated gitignore

* Delete CALIBRE_FIELD_MAPPING_REFERENCE.txt

* Remove unnecessary files: example.epub and og_metadata.java

* Refactor EpubMetadataExtractor to address PR review feedback

- Eliminate DRY violations in identifier extraction with helper methods
- Fix Build-to-Check anti-pattern using processedFields tracking
- Move regex patterns to static constants to avoid recompilation
- Replace magic numbers with calculated prefix lengths
- Consolidate repetitive Set field and pagecount parsing patterns
- Remove excessive documentation and comments
- Remove unrelated .dockerignore and .gitignore entries

* chore: trigger CI/CD pipeline

* Add @Singular annotation to collection fields to support builder accumulation

* Update identifiers to URN format for Calibre compatibility

* fix: resolve MetadataChangeDetectorTest failures and enhance Calibre EPUB integration

- Fixed NullPointerException in testEdgeCase_emptyCollectionToNull_returnsTrue()

- Fixed NullPointerException in testHasValueChanges_whenEmptySetToNull_returnsTrue()

Implementing @Singular for moods and tags prevents metadata fields from being null,

which then fails edge test cases. Since we are no longer double looping during

metadata extraction, @Singular is not needed. Removing it allows the edge case

tests (by Balázs Szücs) to pass.

- Removed douban fields from persistence layer (kept in DTO for DoubanBookParser)

I was under the impression we were saving this value to the DB, but as far as I

can find, we only use Douban data for searching. Adding to the identifiers section

would raise issues with the database not having where to store that value.

Database modifications are left to the professionals.

- Added support for all identifier formats (URN and simple prefix)

Calibre only detects identifiers during IMPORT if they are in URN format.

However, it saves them back as simple prefix. Booklore now handles both.

- Added removeAllCalibreMetadata() to strip all Calibre traces

Cleans up saved EPUBs in Booklore's library, removing all Calibre metadata traces.

- Ensures clean EPUB 3 compliant output with only booklore:* tags

ALL metadata is now saved by Booklore into EPUBs using booklore:* tags.

This preserves Booklore's metadata and we can read it back during import.

Calibre support is ONLY during IMPORT, as it should be since this is the

Booklore project.

(If Calibre users want to extract Booklore metadata, they can build a Calibre

plugin to extract booklore:* tags.)

No longer use #genres or #categories. We stick to dc:subject as suggested,

and Booklore tags can be read from Calibre custom column #extra_tags.

We store tags as booklore:tags.

Removed all tests that used #genres/#categories.

Added tests to check booklore:* tags extraction.

* fix: Remove DoubanId copy helper call - upstream MetadataClearFlags missing isDoubanId()

* Fix Calibre moods and tags extraction from EPUB metadata

- Add fallback logic to check alternative key names (value, #val#) if #value# is missing

- Maintain compatibility with upstream metadata structure changes

* fix: resolve rebase conflicts and compilation errors - Fixed missing closing brace in MetadataRefreshService.java - Added MoodRepository and TagRepository to BookCreatorService - Added addMoodsToBook() and addTagsToBook() methods - Fixed EpubProcessor to use new methods

* Restore Booklore's metadata persistance, Logic Lost during Rebase + Added support for Lubimyczytac and ranobedb

Fixed lubimyczytac metadata not saving during EPUB bookdrop imports.

Root cause: The Angular bookdrop form was missing lubimyczytacId and lubimyczytacRating fields, preventing these values from being sent to the backend during finalization.

Backend fixes:

- EpubMetadataExtractor: Fixed method references with explicit lambdas for lubimyczytac field setters (ranobedb also updated preventively)

- BookMetadataUpdater: Fixed method references with explicit lambdas for lubimyczytac field updates (ranobedb also updated preventively)

Frontend fix:

- bookdrop-file-review.component.ts: Added lubimyczytacId and lubimyczytacRating form fields to createMetadataForm() and resetMetadata() methods

This ensures lubimyczytac metadata extracted from EPUB booklore:tags flows correctly through: extraction → database → UI form → backend → final book record.

* Restore Original ONLY Calibre custom column name to #pagecount So as not to break other users flow.

* fix: resolve compilation error in EpubProcessor.java - Changed bookEntity.getFileName() to bookEntity.getPrimaryBookFile().getFileName() to fix gradlew build check

* Add EPUB 3 compliant prefix declaration for custom booklore metadata

Declares the booklore: prefix in the package element's prefix attribute according to EPUB 3 specification for custom vocabularies.

* Move hardcoverBookId to standard URN identifier format

Changed hardcoverBookId from custom booklore metadata to standard dc:identifier with urn:hardcoverbook: prefix for consistency with other identifiers.

* UPDATE: migrate hardcover_book_id to VARCHAR and fix related issues

## Changes

### 1. Database Migration
- Changed hardcover_book_id column from INTEGER to VARCHAR(255)
- Supports alphanumeric book IDs from Hardcover API
- Updated HardcoverSyncService to handle String ↔ Integer conversion

### 2. Metadata Editor Fixes
- Fixed metadata change detection for provider-specific fields
- Added missing clearFlags entries: hardcoverBookId, lubimyczytacId, lubimyczytacRating
- Resolves issue where rating/review count fields wouldn't save independently

Affected fields now save properly independently:
- Amazon rating & review count
- Goodreads rating & review count
- Hardcover rating & review count
- Lubimyczytac rating
- Ranobedb rating

### 3. Web Reader Hardcover Sync (Major Fix)
Since I changed the data type for hardcover_book_id I had to update references in the HardCoverSyncService.java This turned out to reveal
the Sync Service was not fully implemented:
- Added Hardcover progress sync to ReadingProgressService
- Previously, HARDCOVER sync only worked for Kobo and KOReader devices
- Web browser reading progress now syncs to Hardcover.app

## Files Modified
- booklore-api/src/main/resources/db/migration/V107__Change_hardcover_book_id_to_varchar.sql
- booklore-api/src/main/java/.../service/hardcover/HardcoverSyncService.java
- booklore-api/src/main/java/.../service/progress/ReadingProgressService.java
- booklore-ui/src/app/features/metadata/.../metadata-editor.component.ts

## Breaking Changes
None - migration handles existing integer IDs gracefully

## Testing
- Hardcover sync tested with web reader
- Metadata editor field updates verified
- Database migration confirmed successful

---------

Co-authored-by: ACX <8075870+acx10@users.noreply.github.com>
2026-01-29 17:59:50 -07:00
PhasecoreX 09d4a3025a fix(api): Select correct Hardcover.app ISBN from lookup results (#2530) 2026-01-29 17:55:30 -07:00
Sergio Visinoni 4db2006afd test(API): add missing tests for BookMapperV2 (#2495)
* fix(API): add missing fields to BookMapperV2

This fixes a regression introduced in the data model refactoring work
for multi-format support.
BookMapperV2 was missing mapping for file-related fields.

* Added missing mappings for BookMapperV2
* Added a test for BookMapperV2 to prevent future regressions

* fix(api): fix the code after rebase
2026-01-29 17:46:14 -07:00
Balázs Szücs 878bc44138 fix(library-processing): re-fetch library entity after clearing entity manager during rescan (#2507)
* fix(library-processing): re-fetch library entity after clearing entity manager during rescan

Ensure the latest library entity state is retrieved after clearing the entity manager in rescanLibrary. Add test to verify fresh entity is used for subsequent processing.

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* test(library-processing): update rescan test to verify grouping service usage and remove obsolete assertions

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

---------

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
2026-01-27 16:38:30 -07:00
Balázs Szücs 257c016f3f fix(metadata-parsers): improve ISBN search logic and fallback strategies for metadata fetching (#2502)
* fix(metadata-parsers): improve ISBN search logic and fallback strategies for metadata fetching

- Update GoogleParser, HardcoverParser, and ComicvineBookParser to prioritize ISBN search and implement robust fallbacks to title+author and title-only queries
- Refactor GoogleParser to allow dependency injection for HttpClient and Jsoup connections, improving testability
- Enhance HardcoverParser to retry with title-only search if combined title+author results are filtered out
- Adjust MetadataRefreshService to prefer ISBN-13 over ISBN-10 when building fetch requests
- Add JsoupConnectionFactory and DefaultJsoupConnectionFactory for injectable Jsoup connections
- Expand and improve unit tests for GoogleParser and HardcoverParser to cover new fallback behaviors

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* fix(google-parser): handle null primary file and correct search term return

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

---------

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
2026-01-27 16:37:28 -07:00
Balázs Szücs 58bfe2293a fix(metadata-refresh): correct provider priority order and enhance REPLACE_ALL handling (#2503)
- Update provider priority logic to ensure P1 > P2 > P3 > P4 for all metadata fields
- Refactor buildFetchMetadata to accept existing metadata and preserve fields when using REPLACE_ALL mode
- Adjust service and test method signatures for new parameter
- Add unit test to verify provider priority order

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
2026-01-27 16:35:06 -07:00
ACXandacx10 3f334202b6 Introduce multi-format book support, including audiobooks (#2486)
* fix: support reading alternative book formats using bookType query param

* feat: add streaming reader support for alternative EPUB formats

* refactor: extract tabs section into MetadataTabsComponent

* feat: implement per-file reading progress tracking

* feat: add configurable format priority with cascading fallback

* refactor: redesign library creator with single-page layout

* refactor: unify reading progress into ReadingProgressService

* refactor: improve delete options with clearer file format and book deletion

* refactor: improve book format matching with normalization and fuzzy fallback

* feat: add folder-based audiobook support with ZIP downloads and preparing state

* fix: display unique format types in metadata viewer

* refactor: auto-attach files to single book in folder during rescan

* feat: implement folder-centric book file grouping with fuzzy matching

* refactor: consolidate book grouping with organization mode support

* fix: use folder hash for folder-based audiobooks in auto-attach

* fix: delete only BookFileEntity on file removal, not entire book

* fix: set folderBased flag and correct file size for auto-attached audiobook folders

* fix: use count query to avoid lazy initialization in file delete handler

* fix: preserve book metadata when file is moved by detecting hash match

* fix: skip books with no files in restoration to avoid NPE

* fix: round all progress percentages to one decimal place before sending to UI

* style: improve library creator dialog spacing and layout

* fix: migrate FOLDER_AS_BOOK to BOOK_PER_FOLDER for backwards compatibility

* fix: FileMoveService now handles multi-file BookEntity properly

* style: redesign metadata-picker and file-mover UI components

* style: redesign file-naming-pattern UI and improve theme contrast

* style: relax spacing in library-creator component

* style: tighten directory-picker layout for consistency

* fix: PathPatternResolver now respects folderBased flag for audiobooks

* style: move checkmark column to left side and add pending status in file-mover

* refactor: consolidate BookFileType into BookType and add audiobook styling

* feat: show 'Continue Reading' button for in-progress books

* fix: preserve dots in folder names during grouping and prevent duplicate attachments

* style: reduce gap between download-all button and primary file section

* style: shorten 'Continue Reading' button to 'Read' on mobile

* feat: add DISK_TYPE config to disable file moves on network storage

* style: standardize settings pages with shared styles and consistent spacing

* style: revamp settings pages with modern card-based layouts

* style: revamp OPDS, auth, and task management settings layouts

* fix: update FileMoveService tests to include AppProperties parameter

* fix: derive BookFileType from extension when uploading additional book files

* feat: show format type and size in download button with dropdown for alternatives

* feat: add audiobook streaming player with HTTP Range support

* feat: add M4B chapter extraction and chapter navigation

* feat: add audiobook bookmarks and sleep timer

* refactor: split AudiobookReaderService into focused services

* feat: add Media Session API for background audio playback

* feat: display file extensions in format tags with distinct colors and add audiobook upload support

* feat: require bookFileId for viewer settings API

* fix: show split button for audiobooks with readable alternatives

* feat: improve reading sessions table with book type badges and better formatting

* feat: add audiobook play button in files tab

* feat: use file extension for format display and meaningful tab values

* feat: add extension field to BookFile DTO

* feat: use extension field for book card format pill

* fix: use mixed orientation for format priority drag-drop to support multi-line layout

* feat: add attach book files feature to consolidate single-file books

* fix: increase drag handle size for format priority chips

* fix: add missing BookFileRepository mock to BookServiceDeleteTests

* feat: add delete buttons to files tab and move shelf to other items menu

* feat: add physical books support for cataloging books without digital files

* refactor: redesign icon-picker component with improved styling

* refactor: redesign metadata-picker component with improved layout and alignment

* refactor: move Add Physical Book to top of library menu

* refactor: use p-autoComplete for authors/categories in add-physical-book dialog

* feat: add square cover search and display support for audiobooks

* fix: navigate to first page when opening unread ebooks

* fix: exclude API requests from service worker interception

* feat: support fileless books with automatic file attachment

* fix: bypass service worker for audiobook streaming requests

* refactor: remove alphabetical filter sorting, default to count, limit filters to 100

---------

Co-authored-by: acx10 <acx10@users.noreply.github.com>
2026-01-27 10:12:50 -07:00
Balázs Szücs 21076d4f5d fix(scan-library): prevent NPE during rescan for books with missing file associations (#2429)
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
2026-01-23 10:25:31 -07:00
ACXandacx10 5d9e535a14 Fix email sending failure due to lazy-loaded bookFiles outside session (#2404)
Co-authored-by: acx10 <acx10@users.noreply.github.com>
2026-01-22 16:10:26 -07:00
ACXandacx10 eb57af85a5 Fix showstopper bugs in v1.18.0 (#2399)
- Fix issue with hardcover toggle not being selectable
- Resolve syncing problem with Booklore toggle
- Address CSS warnings for cleaner styling

Co-authored-by: acx10 <acx10@users.noreply.github.com>
2026-01-22 13:27:06 -07:00
BAE 48b615d529 Refactor: Enhance healthcheck response with version info and DTO (#2378)
* Refactor: Enhance healthcheck response with version info and DTO

* test: Enhance healthcheck response with version info and DTO
2026-01-21 22:38:44 -07:00
Balázs Szücs 193c9495a1 feat(google-parser): improve Google Books API integration with improved metadata handling and series extraction (#2375)
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
2026-01-21 22:37:04 -07:00
boludo00andakiraslingshot 67c12223ea fix: Refactor HardcoverSyncService to improve edition and page count (#2389)
* fix: Refactor HardcoverSyncService to improve edition and page count fetching logic. Always fetch edition and page info from Hardcover when a stored book ID is available. Update variable names for clarity and ensure fallback mechanisms are in place for missing data.

* fix: Update key in HardcoverSyncServiceTest to reflect correct edition ID naming convention

* feat: Enhance reading progress tracking in HardcoverSyncService by adding isFinished parameter to upsert methods. This allows for recording completion dates when a book is finished.

---------

Co-authored-by: akiraslingshot <akiraslingshot@gmail.com>
2026-01-21 22:35:19 -07:00
Balázs Szücs b2eb303964 feat(metadata): simplify series name extraction by removing volume suffix (#2385)
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
2026-01-21 22:32:46 -07:00
Balázs Szücs 5451bb470a feat(metadata): add replace mode option for metadata fetching (#2356)
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
2026-01-20 09:21:50 -07:00
Balázs Szücs 4e27b8afab feat(library): add validation for library path accessibility during rescan (#2347)
* feat(library): add validation for library path accessibility during rescan

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* feat(BookMapper): add mappings for primary file attributes in BookMapper

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

---------

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
2026-01-20 08:48:54 -07:00
ACXandacx10 7efb0e138d Implement streaming EPUB reader with on-demand loading (#2350)
Co-authored-by: acx10 <acx10@users.noreply.github.com>
2026-01-19 18:07:57 -07:00
Balázs Szücs da83a70281 fix(PathPatternResolver): remove leading slash from resolved pattern if first component is empty (#2339)
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
2026-01-19 08:50:45 -07:00
AJ Banck c7fa64c045 fix(epub): add cover extraction fallback using meta cover attribute (#2310)
Add fallback mechanism to extract EPUB cover images when the primary
epub4j getCoverImage() method returns null. The new fallback reads
the 'cover' meta attribute from EPUB metadata and uses it to look up
the cover resource by ID.

This improves cover detection for EPUBs that use the traditional
<meta name="cover" content="image-id"/> and the cover image href
uses a URL-encoded special character which epub4j can't resolve.

Changes:
- Add cover extraction fallback via getMetaAttribute("cover")
- Add null safety check for coverId before resource lookup
- Add test with URL-encoded href to verify proper path handling
2026-01-19 08:47:06 -07:00
69c3c88375 Feat/komga api (#2071)
* Implement Komga API endpoints with OPDS authentication

Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>

* Add database migration and documentation for Komga API

Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>

* Address code review comments - improve performance and maintainability

Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>

* chore: update with main develop

* chore: log cleanup

* chore: fixed switch with missing types

* chore: missing case

* Merge pull request #4 from farfromrefug/copilot/fix-500-error-on-books-api

Fix NPE in Komga books API when pageCount is null and add unpaged parameter

* Add collections endpoint and page download with PNG conversion support

Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>

* Address code review feedback for better resource management and error messages

Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>

* Fix convert parameter to match specification (convert=png)

Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>

* chore: renamed migration

* chore: migration

* chore: migration fix

* chore: should work now

* chore: settings

* chore: working with mihon

* Initial plan

* Add clean query parameter for Komga API endpoints

Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>

* Address code review comments - remove unused imports and add @Primary annotation

Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>

* Add demo test to illustrate clean mode effectiveness

Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>

* Support both ?clean and ?clean=true syntax

Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>

* Filter out empty arrays in clean mode

Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>

* chore: missing field

* chore: missing field

* chore: fix error with missing number

* fix: added groupUnknown API parameters to sort by "Unknown Series" (true by default)

* Initial plan

* Convert groupUnknown from query parameter to Booklore setting

Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>

* Remove unused groupUnknown variables from service and mapper

Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>

* chore: fix seriesTitle in ungrouped unknowns

* Initial plan

* Optimize Komga API performance for series listing

- Optimize getAllSeries to only convert series on current page to DTOs
- Optimize getBooksBySeries to fetch books only once (not twice)
- Add database query methods for future optimizations
- Update tests to work with new optimizations
- All existing tests pass

Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>

* Clean up unused database query methods in BookRepository

Remove unused optimization queries that don't align with application-level series grouping logic

Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>

* Optimize getAllSeries to query distinct series names from database

- Add database queries to fetch distinct series names directly (no need to load all books)
- Add queries to fetch books only for specific series (when building DTOs)
- Support both groupUnknown=true and groupUnknown=false modes
- Add test to verify optimization works and books aren't loaded unnecessarily
- Performance improvement: For 1000+ books grouped into 100+ series, now only queries series names (~100 rows) instead of loading all books (~1000+ rows), then loads books only for the current page (~20-50 books per series on page)

Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>

* chore: migration fix from merge

* chore: address comments

* fix: handle getBookPage for PDF/CBX

* chore: rename migration

* chore: komga specific series queries fix

* chore: komga tests fix

* chore: front end komga tests

---------

Co-authored-by: Aditya Chandel <8075870+adityachandelgit@users.noreply.github.com>
Co-authored-by: ACX <8075870+acx10@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-01-19 08:44:53 -07:00
ACXandacx10 a39043c2a0 Revamp streaming PDF reader to render pages on demand (#2332)
Co-authored-by: acx10 <acx10@users.noreply.github.com>
2026-01-18 22:38:19 -07:00
Balázs Szücs a0f4c8e43e feat(hardcover): implement book details response and search service enhancements (#2303)
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
2026-01-18 18:19:58 -07:00
Balázs Szücs 0a3c6d72fa fix(metadata): ensure authors/genres are replaced, not merged, during metadata update by defaulting mergeCategories to false (#2304)
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
2026-01-18 18:19:13 -07:00
ACXandacx10 e5b1d33bf7 Add support for annotations and book notes in the new ebook reader (#2313)
Co-authored-by: acx10 <acx10@users.noreply.github.com>
2026-01-17 22:36:00 -07:00
ACXandacx10 d75e7e228a Bidirectional progress sync between koreader and booklore reader (#2312)
Co-authored-by: acx10 <acx10@users.noreply.github.com>
2026-01-17 22:29:02 -07:00
ACXandacx10 8c35f2415c Introduce a new eBook reader with support for EPUB, MOBI, AZW3, and FB2 formats (#2258)
Co-authored-by: acx10 <acx10@users.noreply.github.com>
2026-01-15 20:39:52 -07:00
Balázs Szücs 775887b55f feat(shelf): add shelf filtering options and integrate into book processing (#2268)
* feat(shelf): add shelf filtering options and integrate into book processing

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* fix(book-rule-evaluator): normalize array values to lowercase for rule comparisons

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* feat(filter): enhance library and shelf filtering logic for 'or' and 'and' modes

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* feat(shelf): implement support for multiple shelf IDs in book retrieval and filtering

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

---------

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
2026-01-15 19:58:30 -07:00
Sergio Visinoni 2be02017d4 (Refactor) Extract file-specific information from book (#1734)
* refactor(book): extract file-specific information from book

First commit in a series aimed at refactoring the data model for books.
More specifically, the idea is to extract all file-specific information
from the `book` table and move it to the `book_file` table, previously named `book_additional_file`

The aim is to make it easier to:
* Improve support for books with multiple file formats (PDF, EPUB, etc) for all interactions (Read, Download, etc)
* Support for merging/unmerging books
* Add support for additional file types
* Specify preferred formats at the user level

Ref: #489

* refactor(book): ensure the API build and runs

Further work on the refactoring aimed at separating file-related details
from the `book` table.

With this commit all the missing changes that were prventing the API to build
or to book have been addressed.

TODO: test extensively, adjust existing unit tests and add new ones

* fix(read): add mapping for book format

This restores the read functionality which relies on the book format field
to decide which reader to use.

* fix: fix read, dowload and file upload

This commit fixes multiple issues either caused by the refactoring or pre-existing:

* Fix the Read button behaviour after the refactoring
* Unregister the watcher process when uploading additional formats
* Fix downloading of additional book formats (using the wrong ID)

* fix: adjust tests to use the new BookFileEntity class

All the tests that used to fecth file information from BookEntity
now need to get them from the relevant BookFileEntity

* fix: do not rely on AdditionalFileType

* Use the BookFileEntity bookFormat instead

* fix: use the relevant BookFileEntity class

* fix: call the right methods

* fix: Add missing mapping for the test

* fix: adapt the test to the new semantics

All book files, including the primary one, are treated as equal now.
The tests needs to take that into account when checking for additional
formats.

* fix: use mutable lists

* fix: fix syntax for droppung unique constraint

MariaDB uses indexes, not constraints

* fix: regression on book file ordering

We want to make this refactoring 100% compatible with the current behaviour (modulo a few bugs),
therefore we need to maintain the right order to ensure the "primary" book stays the same
after the migration.

* fix: allow download of supplementary files

* fix(opds): replace removed additionalFiles entity graph with bookFiles

- Update BookOpdsRepository @EntityGraph paths to use BookEntity.bookFiles after the refactor
- Add @DataJpaTest to validate BookOpdsRepository wiring and catch invalid EntityGraph attributes
- Add H2 as testRuntimeOnly dependency so the JPA slice test can run with an embedded DB

* chore(bookdrop): mount bookdrop folder from a local directory

It's consistent with the library dir, and makes debugging easier
when working on the local environment

* fix: rename migration after rebase

It's no longer 66, bumped to 73

* fix: handle BookEntity primary file NPEs after rebase

Adjust tests to always instanciate BookFileEntity when manipulating
BookEntity.

* chore: rename migration to avoid conflict

V73 is already taken on develop, V67 was left "unused"

* chore: rename again to ensure it's applied

* fix: make sure to flush the data to DB

Without the flush there is a high chance of leaving the DB in an inconsistent
state after a book move.

* fix: move all files belonging to a book

This fixes a pre-existing bug which has some nasty ramifications.
We never moved "additional files" when changing library for a book entity,
causing them to become effectively "unreacheable" from the UI.

* fix(migration): remove the unique index before importing data

* fix: fix build and test after rebase

* fix(migration): drop legacy table

* fix(upload): use the templetized name when storing on DB

* fix(rebase): Add logical fixes post rebase

* Adapt the code to properly handle the new `archive_type` field and logic
* Bump the version number for the DB migration
* Use `getPrimaryBookFile()` whenever trying to access book files

* fix(migration): Handle additional book formats

* Add support for FB2 files
* Corretly handle cb7 files as CBX

* fix(file mover): fix a regression when moving books across categories

The previous approach would trigger the JPA's `orphanRemoval` parameter on the
bookEntities, effetively triggering a delete on the DB.

This caused files to be moved but the data on the DB would get stale, also causing
additional formats to be treated as separate books upon a rescan.

* fix(rescan): do not delete alternative files on rescan

Upon library rescan, additional files such as images were removed from
book entities association when using the "Each file is a book" library structure.
2026-01-15 18:15:00 -07:00
Balázs Szücs 9761c0e9b6 feat(OpdsFeedService): detect ZIP mime type for FB2 files when zipped (#2242)
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
2026-01-12 17:01:22 -07:00
Balázs Szücs 64f036fb71 fix(epub): strip formatting from ISBN values to ensure correct extraction (#2248)
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
2026-01-12 17:00:52 -07:00
ACXandacx10 4543381814 Stream CBZ contents directly from the archive instead of unzipping and caching files (#2229)
Co-authored-by: acx10 <acx10@users.noreply.github.com>
2026-01-10 10:41:34 -07:00
Arden RasmussenandACX 4f012746c5 RanobeDB Light Novel metadata provider (#2221)
* feat(metadata): added ranobedb metadata provider for light novels

* fix(metadata): remove ranobedb review count and fix merge conflicts

* test(metadata): added unit tests for RanobeDB parser

* fix(metadata): add ranobedb to updated metadata searcher

---------

Co-authored-by: ACX <8075870+acx10@users.noreply.github.com>
2026-01-10 10:21:39 -07:00
Balázs Szücs 105f477c79 feat(archive): add ArchiveType via Magic Numbers detection and integrate into book processing (#2220)
* feat(archive): add ArchiveType detection and integrate into book processing

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* feat(cbx): enhance archive type detection for CBX files

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

* refactor(tests): rename method for clarity in CbxMetadataWriterTest

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>

---------

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
2026-01-10 10:04:50 -07:00
Balázs Szücs 24fabc97de fix(epub): normalize text nodes in EPUB metadata content.opf (#2222)
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
2026-01-10 10:02:06 -07:00
Gavin Mogan 9f019f0636 fix: Ignore access denied when doing library scan instead of failing (fixes #1342, #2122) (#2132) 2026-01-09 14:03:23 -07:00
ACXandacx10 15007143f9 Add per-user font management permission (#2210)
Co-authored-by: acx10 <acx10@users.noreply.github.com>
2026-01-08 19:19:14 -07:00
77bb2904e3 Feature/koreader hardcover sync (#2204)
* feat(settings): add hardcover sync settings and integrate into device settings UI

* feat(hardcover): implement Hardcover sync settings API and UI integration

* test(hardcover): add unit tests for HardcoverSyncSettingsService and HardcoverSettingsComponent

* fix(hardcover-settings): correct API key copy function to handle null values properly

---------

Co-authored-by: akiraslingshot <akiraslingshot@gmail.com>
Co-authored-by: ACX <8075870+acx10@users.noreply.github.com>
2026-01-08 16:14:51 -07:00
Balázs Szücs 14dcf552bd fix(cbx): "Archive too large" error for invalid/corrupt CBX files (#2205)
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
2026-01-08 15:18:40 -07:00
ACXandacx10 15de049f3d Support individual “write to file” settings per book type, with configurable file size limits (#2206)
Co-authored-by: acx10 <acx10@users.noreply.github.com>
2026-01-08 15:18:20 -07:00
Balázs SzücsandACX f0444df6ee refactor(images): migrate to TwelveMonkeys ImageIO with graceful unsupported format handling (#2188)
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
Co-authored-by: ACX <8075870+acx10@users.noreply.github.com>
2026-01-07 18:12:12 -07:00
Balázs Szücs 81442a1e5c feat(metadata): enhance XML parsing with secure processing and improved error handling (#2163)
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
2026-01-06 10:12:29 -07:00
926b87872e feat: Add custom font support for EPUB reader (#2120)
* feat: Add custom font support for EPUB reader

This commit introduces the ability to manage and use custom fonts in the EPUB reader. Key changes include:

**Backend:**
- Added `CustomFontService` for handling custom font operations.
- Introduced `CustomFontController` for API endpoints.
- Created `CustomFontEntity` and `CustomFontRepository` for database interactions.
- Added `CustomFontMapper` and `CustomFontDto` for data transformation.
- Updated `SecurityConfig` to include JWT filter for custom fonts.
- Enhanced `GlobalExceptionHandler` to handle custom font-related exceptions.
- Added database migrations:
  - `V83__Create_Custom_Font_Table.sql` for creating the custom font table.
  - `V84__Add_Custom_Font_To_Epub_Preferences.sql` for integrating custom fonts with EPUB preferences.

**Frontend:**
- Added `CustomFontsComponent` and `FontUploadDialogComponent` for managing custom fonts in the settings UI.
- Updated `EpubReaderPreferencesComponent` to include custom font options.
- Introduced `CustomFontService` and `CustomFontModel` for frontend logic and data handling.
- Enhanced `SettingsComponent` to integrate custom font management.

**Other Changes:**
- Updated `EpubViewerPreferences` and `EpubViewerPreferencesEntity` to support custom fonts.
- Modified existing components and services to accommodate the new feature.

This feature enhances the user experience by allowing personalized font choices for EPUB reading.

* fix: custom font does not apply after page layout changed

* fix: duplicate API call when change EPUB global settings

* fix: some code review items, extract shared filter logic and improve UX

- Extract AbstractQueryParameterJwtFilter base class to reduce code duplication
  between CoverJwtFilter and CustomFontJwtFilter
- Remove cssIdentifier and fontUrl fields from CustomFont model (no longer needed)
- Add font name sanitization to prevent XSS and ensure data integrity
- Improve error handling in CustomFontService with proper APIException usage
- Replace RuntimeException handler with specific IllegalStateException and
  UnsupportedOperationException handlers in GlobalExceptionHandler
- Add skeleton loading states for font previews and font dropdowns
- Improve font loading state management in epub-reader component
- Create shared custom-font.util.ts for dropdown population logic
- Use reactive font$ subscription for real-time font updates in preferences
- Make DB migrations idempotent with IF NOT EXISTS clauses
- Optimize font file validation to read only header bytes instead of entire file

* chore: re-version migration scripts

* Fix: Kobo sync missing book covers (v1.16.4) (#2147)

Co-authored-by: acx10 <acx10@users.noreply.github.com>

* Fix: correctly update book cover hash on metadata refresh (#2149)

Co-authored-by: acx10 <acx10@users.noreply.github.com>

* Introduce Vitest as the frontend Angular testing framework for Booklore (#2150)

Co-authored-by: acx10 <acx10@users.noreply.github.com>

* Add Vitest frontend tests to CI with JUnit reporting and coverage (#2151)

Co-authored-by: acx10 <acx10@users.noreply.github.com>

* Update PR template to capture frontend test details

* Add instructions for running Angular frontend tests

---------

Co-authored-by: ACX <8075870+acx10@users.noreply.github.com>
Co-authored-by: acx10 <acx10@users.noreply.github.com>
2026-01-05 14:45:29 -07:00
CounterClops 34bbe8a14e fix(api): kobo proxy server unit tests (#2136)
* fix: resolve issue with kobo proxy failing to reencode encoded query params

* fix: add additional tests for kobo server proxy
2026-01-05 14:26:41 -07:00