Commit Graph
255 Commits
Author SHA1 Message Date
Balázs Szücs 5c42e2e765 refactor(api, test): improve readability and code quality across services, and tests (#1494)
* refactor(tests): improve readability and consistency across services

- Replace field declarations with local variables in test setup methods to simplify code.
- Introduce constants for patterns and update regex logic in `BookMediaController`.
- Improve assertions and use more precise methods like `getFirst()` in tests.
- Utilize `EnumMap` and `EnumSet` for better performance and memory efficiency in metadata logic.
- Concatenate XML strings using multi-line strings or simplify where applicable.
- Deprecate and refactor user provisioning to ensure consistency and reuse of logic.
- Add additional parameters such as `watch` in `Library` entities and set defaults in builders.
- Replace manual comparator logic with core library features like `Comparator.reverseOrder`.
- Update metadata merging methods to use `getFirst()` for target values.
- Adjust mocked objects to include additional fields in validation methods.

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

* refactor(service): remove deprecated user provisioning method

- Remove `provisionRemoteUser` method marked as deprecated in `UserProvisioningService`.
- Encourage use of `provisionRemoteUserFromHeaders` as the preferred entry point.

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

---------

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
2025-11-20 21:09:39 -07:00
Subhashini Ganesh cb8f5e7a29 Fix: Normalize paths for relative sub-path calculation (#1501)
Fixes a bug preventing import of books with duplicate filenames in
different sub-folders.

The path relativization in FileUtils.getRelativeSubPath would fail in
some cases, yielding an empty sub-path. This caused a database
unique index violation as only the filename was saved as the filePath.

This commit fixes the issue by normalizing both paths before
relativization. Adds FileUtilsTest.java to validate the fix.

Fixes #1499
2025-11-20 21:08:39 -07:00
Balázs Szücs b592e3677a refactor(tests): replace runtime-dependent timestamps with fixed values (#1469)
- Introduced fixed timestamps for `Instant` and `LocalDateTime` in multiple test classes.
- Replaced calls to `Instant.now()` and `LocalDateTime.now()` with predefined fixed values for consistency and test stability.

Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
2025-10-31 01:18:43 -06:00
Aditya Chandel 5fe62ac576 Implement task scheduling system (#1427)
* Implement task scheduling system

* Remove tests
2025-10-23 22:49:42 -06:00
Aditya Chandel 9186ea0c67 Refactor file mover to ensure faster transfers and more reliable handling (#1406) 2025-10-21 21:10:46 -06:00
Aditya Chandel 8a795985aa Consolidate OPDS endpoints and implement structured navigation feeds (#1375) 2025-10-17 13:16:15 -06:00
Aditya Chandel d90cb73148 Unify TasksV1 and TasksV2 implementations (#1358) 2025-10-15 19:59:30 -06:00
Aditya Chandel b3b63cce74 Add task management panel with live task status and controls (#1322) 2025-10-11 20:08:56 -06:00
Aditya Chandel 28081a1681 Add Metadata Manager for organizing and standardizing metadata (#1312) 2025-10-10 09:08:42 -06:00
Aditya Chandel 7133ef1a69 Upgrade project environment to Java 25 and Gradle 9 (#1277) 2025-10-06 12:53:34 -06:00
Aditya Chandel 23aa45b264 Implement EPUB page spread feature for desktop (#1267)
* Implement EPUB page spread feature for desktop

* Implement EPUB page spread feature for desktop
2025-10-05 10:28:16 -06:00
Aditya Chandel ff230f34fc Enhance metadata options to allow skipping fields during fetch and support extended field options (#1263) 2025-10-05 00:15:11 -06:00
Aditya Chandel 41f68a6075 Add support for moods and tags in book metadata (#1262) 2025-10-04 19:02:25 -06:00
Aditya Chandel 879d147e84 Improve notifications to display live progress for ongoing batch metadata fetches (#1242) 2025-09-30 14:31:14 -06:00
Aditya Chandel 131b19f49f Introduce per-library settings for metadata fetching (#1239) 2025-09-30 00:07:59 -06:00
Aditya Chandel 2dcfe00ddc Drop legacy OPDS and keep only the new implementation (#1236) 2025-09-28 16:54:08 -06:00
Aditya Chandel 06523d4c24 Add setting/toggle to automatically download reviews (#1221) 2025-09-26 14:39:52 -06:00
Aditya Chandel f82b22145c Add ability to move books across libraries (#1210) 2025-09-25 20:47:12 -06:00
Aditya Chandel 907d33d206 Adding {subtitle} to the file naming patterns variables (#1195) 2025-09-22 19:52:54 -06:00
Aditya Chandel 6565368a55 Fix: Two users cannot put the same book on their Kobo shelves (#1189) 2025-09-22 18:04:41 -06:00
Aditya Chandel 03fd812bbc Fix Bookdrop file processing due to duplicate inotify events (#1169)
* Filter "Continue Reading" to only show READING, RE_READING, or PAUSED books

* Fix Bookdrop file processing due to duplicate inotify events
2025-09-16 09:41:30 -06:00
Aditya Chandel 1df21551f6 Rollback background blur and transparency due to high CPU/GPU usage (#1160) 2025-09-15 11:03:34 -06:00
Aditya Chandel 6ea2eb58bc Add auto-move option on metadata update and simplify file monitoring (#1137)
- Introduce option to automatically move books when their metadata is updated
- Simplify the file monitoring workflow for improved reliability and clarity
2025-09-12 11:59:36 -06:00
aditya.chandel 7adc2b3f57 Fix test 2025-09-12 10:41:18 -06:00
Ruben GM 4742bd78c3 feat: OPDS v2 support for libraries, shelves (#1129)
* opds v2 support for libraries, shelves

* opds v2 support for recently added filter
2025-09-11 11:45:40 -06:00
Aditya Chandel 1008a9476b Support configurable background image and transparency (#1126) 2025-09-09 22:18:52 -06:00
Ruben GMandCopilot 2e537bb2a1 feat: ComicInfo.xml support for CBX files (#1073)
* write, read ComicInfo.xml for CBZ files

* updated with recommendations from previous PR https://github.com/booklore-app/booklore/pull/1069

* read ComicInfo.xml on CBR, extract first image for CBZ/CBR files, save CBR metadata in ComicInfo.xml as CBZ

* Delete CBR file after CBZ conversion. Update DB

* Backs up file before updating. Restores back up if errored

* Test classes

* Update booklore-api/src/main/java/com/adityachandel/booklore/service/metadata/BookMetadataUpdater.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update booklore-api/src/main/java/com/adityachandel/booklore/service/metadata/writer/CbxMetadataWriter.java

Updating RAR binary availability check

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update booklore-api/src/main/java/com/adityachandel/booklore/service/metadata/extractor/CbxMetadataExtractor.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update booklore-api/src/main/java/com/adityachandel/booklore/service/metadata/extractor/CbxMetadataExtractor.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Code updates from PR suggestions

* Support to extract ComicInfo.xml for .cb7 files

* Writer extension for .cb7 files

* Adding com.github.junrar to build.gradle (forgot in previous commit)

* Settings toggle to control CBR/CB7 to CBZ conversion

* indentation complains

* removed duplicated junrar inport

* Restore comicinfo.xml metadata in edit view

* retrieve ComicInfo.xml metadata for new files in library scan

* private class definition was missed after merge

* Delete 

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-09 08:16:29 -06:00
Aditya Chandel 074d8d6e69 Fix database lockout caused by duplicate files in library (#1102) 2025-09-06 21:22:59 -06:00
Paul c8e78d3bc8 feat: Add comprehensive race condition prevention for file operations (#1085)
- Implement MonitoringProtectionService with thread-safe pause/resume logic
- Add monitoring protection to file operations preventing data loss from race conditions
- Add comprehensive test coverage including concurrent and integration tests

Race condition scenario: File operations (move/delete) detected as "missing files"
by monitoring system before filesystem operations complete, causing incorrect
book removal and data loss.

Solution: Thread-safe monitoring pause during file operations with delayed resume
to ensure filesystem operations complete before monitoring resumes.
2025-09-05 23:11:20 -06:00
aditya.chandel 63dc2bcbc7 Fix issue where metadata updates to file caused books to be removed from booklore 2025-09-02 17:15:06 -06:00
aditya.chandel 0d95817ae8 OPDS v2 fixes 2025-08-31 08:45:59 -06:00
aditya.chandel 443dcad59a Implement OPDS v2 to return user-specific book feeds 2025-08-30 17:02:35 -06:00
aditya.chandel e4fe1ab029 Merge conflict fixes 2025-08-29 10:58:02 -06:00
Iván Ruiz Gázquez 3e64d35957 fix: add content-type header for koreader-sync auth (#1016)
* test: add content-type assertion for user auth

* fix: specify JSON content type in authorizeUser method

Set content type to JSON for user authorization response.
2025-08-29 10:31:45 -06:00
Aditya Chandel 09bc2f6e9e Feature/999 add high resolution cover support upload storage and search (#1006)
* Add high-resolution cover support: upload, storage, and search

* Disable tests until fixed
2025-08-27 21:47:27 -06:00
Alexander PuzyniaandAditya Chandel 694ee11540 Book additional files support library (3/3) (#872)
* feat(api/model): add new entity BookAdditionalFileEntity

* feat(api/db): add book additional file repository

* feat(api/db): add migration

* test(api/db): add book additional file repository test

* test(api/db): add book additional file repository tests for hash uniqueness

* feat(api/domain): add support to additional file model

* feat(api): add additional files controller

* refactor(api): move addAdditionalFile to FileUploadService as uploadAdditionalFile method

* feat(service): search book by additional file

* feat(services): process deleted additional files with ability to promote alternative formats to book instead of deleting them

* refactor(util): use common code to resolve patter for entity and domain object

* feat(service): move additional files

* test(service): test move additional files along with book itself

* feat(ui/domain): add alternativeFormats and supplementaryFiles to book model

* feat(ui/domain): add download additional file method to book service

* refactor(api/domain): extract FileInfo interface with common fields

Allow to share the same interface thet is implemented by AdditionFile and Book

* feat(ui): show multiple download options

* feat(ui/domain): add delete additional file method to book service

* feat(ui): add delete additional file ui

* feat(ui): add additional-file-uploader.component

* feat(ui/domain): add uploadAdditionalFile to the service

* feat(ui): add Upload File menu item

* feat(ui): show supplementary files in download menu item

* feat(ui): show supplementary files in delete file menu item

* feat(ui): book card allow to select single file to download or delete

* feat(api/domain): add scan mode and default book format to the library

* feat(ui): select scan mode and default book format

* feat(api): create/update library settings

* refactor(services): get processor based on scan mode

* feat(services): read all files if processor supports supplimentary files

* fix(services): detectNewBookPaths should check additional files as well

* feat(services): implement folder as book file processor

* test(service): add tests for FolderAsBookFileProcessor

* feat(services): allow follow links for search library files

* test(library): add tests for folder as book file processor

* refactor(library): use Path instead of String for directory path

* feat(library): sort directories before processing

* feat(library): reuse library file book type

* fix(library): do not add additional format if it is used in another book

* test(library): test same hashes files

* refactor(library): simplify FolderAsBookFileProcessor

* test(library): add test with deep folder structure

* test(library): add additional files to existing book

---------

Co-authored-by: Aditya Chandel <8075870+adityachandelgit@users.noreply.github.com>
2025-08-27 08:20:29 -06:00
Alexander Puzynia b81a8d1422 Book additional files support (1/3) (#868)
* feat(api/model): add new entity BookAdditionalFileEntity

* feat(api/db): add book additional file repository

* feat(api/db): add migration

* test(api/db): add book additional file repository test

* test(api/db): add book additional file repository tests for hash uniqueness

* feat(api/domain): add support to additional file model

* feat(api): add additional files controller

* refactor(api): move addAdditionalFile to FileUploadService as uploadAdditionalFile method

* feat(service): search book by additional file

* feat(services): process deleted additional files with ability to promote alternative formats to book instead of deleting them

* refactor(util): use common code to resolve patter for entity and domain object

* feat(service): move additional files

* test(service): test move additional files along with book itself
2025-08-27 08:11:04 -06:00
Aditya Chandel fe8925f65e feat(kobo): add optional EPUB → KEpub conversion for Kobo downloads (#969) 2025-08-23 20:51:04 -06:00
aditya.chandel a092d629c9 Refine bookdrop results and related websocket events 2025-08-16 10:18:33 -06:00
aditya.chandel 800cc4054f Support adding private, user-specific notes to books 2025-08-13 15:54:45 -06:00
aditya.chandel c660497e0b Implement public review fetching from metadata providers 2025-08-13 13:02:53 -06:00
aditya.chandel dd7453fae1 Implement file moving based on library naming rules, falling back to app defaults 2025-08-11 16:59:42 -06:00
aditya.chandel fb5a70c7e7 Allow book upload GUI to upload into Bookdrop 2025-08-09 00:50:50 -06:00
aditya.chandel 850ecb0b0c Improve version checking 2025-08-08 19:54:58 -06:00
Aditya Chandel 9ae1c6e2dc Add koreader sync support for book progress tracking 2025-08-08 09:38:20 -06:00
aditya.chandel f69110c164 feat(bookdrop): add full pagination support with select-all and metadata caching
- Implemented backend pagination for Bookdrop file review
- Updated finalizeImport logic to support select-all with excluded IDs
- Handled partial metadata submission from frontend
- Refactored chunk processing and logging for clarity
- Enhanced frontend Bookdrop UI with paginated selection, metadata sync, and virtual scroll compatibility
- Improved UX for bulk finalize and discard actions
2025-08-05 12:34:44 -06:00
Alexander Puzynia f4207cf9b3 refactor(services): update BookFileProcessor to use BookFileType for processor retrieval 2025-07-23 14:11:27 -06:00
Alexander Puzynia d6c3c8e4c6 test(service): add unit tests for FileAsBookProcessor to validate library file processing 2025-07-23 14:11:27 -06:00
Alexander Puzynia 31e4ae2972 refactor(service): integrate BookFileProcessorRegistry for handling multiple book file formats 2025-07-23 14:11:27 -06:00
aditya.chandel 177528e640 Implement Bookdrop: Watch folder for file drops and auto-process uploads 2025-07-19 11:05:59 -06:00