* 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>
* 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.
* 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>
* 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>
* 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>
* fix(opds): add mime type support for FB2 and CBX formats based on file extension
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
* fix(opds): return correct MIME types for all supported book formats in feed links
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
* fix(opds): remove incorrect MIME type mapping for DJVU and default fallback
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
* test(opds): add unit tests for correct MIME type mapping in catalog feed generation
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
---------
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
* fix(cbz): exclude macOS metadata and hidden files from image extraction
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
* refactor(cbz): restrict isContentEntry method visibility to private in CbxReaderService
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
* test(cbz): add unit tests for macOS metadata file exclusion in CbxReaderService
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
---------
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
* fix(upload): preserve original filename as title when metadata extraction returns temp file name
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
* fix(upload): set original filename as title directly when extracted title is temp name
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
---------
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
* feat: add LubimyCzytac metadata provider
- Add LubimyCzytac parser with web scraping for lubimyczytac.pl
- Extract book metadata including title, authors, description, ratings
- Parse JSON-LD structured data for reliable metadata extraction
- Add database migration with columns and JSON property name updates
- Add comprehensive test coverage for parser
* feat: add LubimyCzytac UI integration
- Add LC ID and LC Rating fields to metadata picker
- Update settings page with Lubimyczytac provider toggle
- Add LubimyCzytac to metadata searcher provider list
- Display Lubimyczytac in all metadata viewer sections
- Add Lubimyczytac to advanced fetch options
- Update TypeScript models to match backend serialization
* Fix(metadata): Don't import creators with a non-author role as author
Looks at either the meta tag for the creators or the opf role attribute
to determine the role of a creator. If no role is specified its assumed
to be an author.
Also only prunes handled created roles when writing the epub data back
out to prevent clobbering any extra data that might be present in the
epub already.
* Fix(metadata): Add testcases for non-author creator handling
Just adds testcases for the previous changes to the extraction and
writer logic.
- Ensure cover image paths in EPUB manifest are URL-decoded before file access
- Update EpubMetadataExtractor and EpubMetadataWriter to handle encoded hrefs
- Add comprehensive tests for unicode and URL-encoded cover image filenames
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
* feat(bookmark): add bookmark editing, priority, color, notes, and improved sorting
- Add UpdateBookMarkRequest DTO and bookmark editing dialog/component in frontend
- Extend BookMark model/entity with color, notes, priority, updatedAt fields
- Implement bookmark update API and service logic with validation
- Sort bookmarks by priority and creation date
- Add Flyway migrations for new columns and index
- Update tests for new bookmark features
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
* fix(bookmark): prevent notes length display error in edit dialog
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
* fix(bookmark): reset editing state and improve dialog cancel handling
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
* fix(bookmark): improve edit dialog template with Angular @if and conditional error display
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
* feat(bookmark): add view dialog, search, and improved display for bookmarks in reader
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
* feat(bookmark): redesign bookmarks section UI with improved layout, styling, and interactions
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
* feat(bookmark): enhance view dialog UI with improved layout, styling, and priority display
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
* chore(migration): rename migration files to maintain sequential versioning
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
* feat(bookmark): add view and edit actions to bookmark list with improved UI and tooltips
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
* feat(bookmark): add search and filter functionality to bookmark list in EPUB reader
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
* feat(bookmark): update search input to use PrimeNG IconField and InputIcon components
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
---------
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>