* refactor(types): improve type safety by replacing 'any' with specific types in various components
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
* fix(filters): handle undefined values in filter streams and update type for selected filters
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
* refactor(epub-reader): improve rendition cleanup and enhance debug logging in helper functions
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
* fix(epub-reader): handle errors during rendition and book destruction in ngOnDestroy
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
---------
Signed-off-by: Balázs Szücs <bszucs1209@gmail.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>
* refactor(types): replace most usages of 'any' with 'unknown' and improve type safety across services and components
- Update method signatures, variables, and interfaces to use 'unknown' instead of 'any'
- Refine event and observable typings for better type inference
- Add or adjust explicit types for function parameters and return values
- Update Chart.js tooltip and context typings for chart services
- Improve type safety in Book, BookState, and related models
- Adjust template bindings and method calls to match stricter typings
- Add SecureSrcDirective for secure image loading with fallback and error handling
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
* chore(angular): remove proxy configuration from development build settings
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
* refactor(book-browser): streamline entity and book state management with reactive streams
- Refactor entity type and entity fetching logic to use observables and combine route params
- Simplify book state handling by consolidating filtering and fetching into a single reactive pipeline
- Remove redundant applySortOption logic and related subscriptions
- Fix book card index binding in template for improved rendering performance
- Ensure proper cleanup of epub rendition in epub-reader component
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
* fix(book-browser, book-uploader): improve permission checks and enhance file upload handling
- Use optional chaining for user permission checks in book-browser.component.html to prevent runtime errors when user data is undefined
- Refactor book-uploader.component.ts to pass destination and IDs explicitly to uploadBatch, reconstruct files for strict type handling, and ensure proper upload flow and UI feedback
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
* refactor(charts, services): improve type safety for book state validation and update form field checks
- Refactor isValidBookState methods across chart components and services to use type predicates and stricter type checks for BookState
- Update metadata-picker.component to simplify array field checks for authors, categories, moods, and tags
- Adjust magic-shelf-utils to remove unnecessary fallback in object spread
- Update notification-event.service to use correct timeout type for highlightTimeout
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
* fix(theme): ensure safe merging of theme properties and improve type definition for themesMap
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
* refactor(epub-reader): streamline book and rendition initialization logic
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
* 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>
* feat: add cover image auto cropping when oversized
* feat: add smart cropping to ignore sections of constant colours in cover images
* fix: description implied cbx files would be excluded from cover regeneration when they are not
* feat: add options to bulk edit cover images in the library view
* fix: resolve issues with batching requests and data validation for cover images
* feat: add bulk editors for bookdrop
* fix: update pattern behaviour and remove redundant frontend logic
* fix: clean up pattern extractor
* fix: create shared logic to align bulk edit and pattern extract and resolve some minor behaviour issues
* fix: date matching pattern and resolve issues with pattern matching to ignore extra trailing data
* chore: cleanup tests and code to be cleaner
* chore: cleanup autogenerated testing rules
* fix: update to use the new dialog launcher service
* fix: add boolean null check and data validation on pattern extract api
* feat: add bulk edit batching to avoid issues with extremely large import counts
* fix: adding timeout to avoid potential redos issue
* fix: add try blocks for issues with potential NumberFormatException
* fix: update isbn and asin regex to better match spec
* fix: improve error handling and logging
* fix: make component names consistent with the project
* fix: mising import for pattern syntax exception
* chore: add additional tests for the bulk edit service
* fix: improve accessibility to new ui elements
* fix: further improvements to the pattern extractor timeout
* fix: improve frontend placeholder validation
* fix: add back changes accidently removed by merge
* feat(bookmark): implement bookmark management with CRUD operations and UI integration
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
* feat(bookmark): add uniqueness constraint for bookmarks and check for existing bookmarks before creation
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
---------
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
* Feature/kobo sync cbx support (#3)
* Feature: Add CBX syncing support to Kobo sync (#2)
* feat: add cbx sync support
* fix: phrasing of setting description to align with CBX terminology
* fix: resolve issue with CBX setting persistence
* fix: updated dev docker compose to align with Dockerfile
* feat: add cbx files as allowed entitlements
* fix: relax tomcat query characters for kobo sync
* fix: remove hardcoded epub restrictions
* fix: reduce image size and resolve relative content paths
* fix: resolve issues with the image file encoding
* feat: add rar and cb7 support
* feat: bring generated epub more in line with epub standard
* fix: resolve issues with extra metadata fields
* fix: make css background colour white to improve e-ink performance
* cleanup: code comments
* feat: add cbx unit tests
* fix: update zipfile to use builder pattern as current method is deprecated
* fix: remove comments
* fix: replace regex pattern to a simpler check
* fix: remove unused imports
* fix: update epub template to use standard language string
* fix: missing line end on css
* fix: remove duplicate query characters
* fix: grammer issue
* fix: resolve typo in the entitlement service test
* fix: redundant imports and update long types
* chore: update test descriptions for cbx conversion
* fix: add check for larger images in archive files. unlikely to occur.
* fix: merge temp dir logic for the book download
* fix: update kobo entitlement to always report the format as epub3
* fix: implement suggested changes around javadocs and some edge cases to handle gracefully
* chore: cleanup variable names to be clearer in download service
* feat: change function to extract to disk instead of storing images in memory
* fix: add temp file clean up into the conversion service
* fix: add visual divider to seperate CBX and EPUB settings
* fix: update lambdas to use method references
* fix: reword setting description for cbx to epub sync
---------
Co-authored-by: Aditya Chandel <8075870+adityachandelgit@users.noreply.github.com>
* feat: add kobo reading progress sync
* fix: remove old variable references
* fix: avoid changing koreader behaviour
* fix: resolve typo in koreader progress
* fix: remove link between booklore progress and kobo sync progress
* feat: add unit tests for kobo reading status sync
* fix: remove unnecessary conversion value for kobo progress
* fix: resolve issue with kobo_progress beiong optional in template
* fix: update entitlement to provide existing reading progress back to kobo on sync
* fix: use stored bookmark before creating new bookmark
* fix: update default thresholds to full numbers. kobo doesn't report progress with any decimal places
* chore: update unit tests
* fix: remove decimal places in kobo settings progress threshold