Commit Graph

591 Commits

Author SHA1 Message Date
neon 854dc55085 fix(books): prevent next-book navigation from sticking at boundaries
Fetch requests now await existing promises for in-flight blocks instead of re-triggering and starving the load when crossing block boundaries. The navigation window entries are also preserved during identical structural updates to avoid infinite watcher loops.

Closes #325
2026-06-14 21:40:59 +00:00
neon 007985a6d0 fix(client): move filter panels out of the scroll container
The Library, Series, and Authors filter panels were rendered inside the
scrolling <main> element, so opening a panel after scrolling down placed
it above the visible viewport and it appeared to do nothing until the
page was scrolled back to the top. Render each panel as a sibling of
<main> so it stays anchored regardless of scroll position. A height cap
is intentionally avoided because the filter typeaheads use absolutely
positioned dropdowns that an overflow container would clip.

Add structural regression tests for the Series and Authors views that
assert the panel renders outside the scroll container.

Fixes #326
2026-06-14 21:16:24 +00:00
neon 101c8d4cce fix(metadata): restore Goodreads fetching via autocomplete fallback when detail pages are WAF-gated 2026-06-14 20:19:15 +00:00
neon e3ee046dc5 fix(metadata): normalize zero page count to null to prevent save errors
When a metadata provider returns a page count of 0 (e.g. unknown), the frontend would submit 0, causing a validation error (HTTP 400). This change normalizes 0 to null on both the client (before sending) and server (during validation).

Closes #329
2026-06-14 07:13:01 +00:00
neon c7f3e8eacb fix(metadata): allow saving edits to re-locked metadata fields
Removes the `assertManualUpdateAllowedForLockTransition` guard that incorrectly rejected the legitimate UI flow of unlocking a field, editing its value, and re-locking it before saving.

Closes #328
2026-06-14 06:44:37 +00:00
Chris Mansell aed22712cc feat(metadata): add LubimyCzytac metadata provider (#324)
* feat(metadata): add LubimyCzytac metadata provider

- Add LubimyCzytac scraper and provider implementation
- Add lubimyczytacId field across types, schema, extractors, and metadata service
- Register lubimyczytac provider in module, pipeline, repository, and config service
- Add provider icon, color, link, and UI support in book detail views
- Add migration for lubimyczytac_id column

Closes #304

* fix(books): keep cover card read button opening reader when thumbnail click prefers details

The overlay primary button should always open the reader regardless of
the thumbnailClickAction setting. That setting only controls card click
behaviour.

* fix(books): add explicit read button to hover overlay when thumbnail click prefers details

When thumbnailClickAction is 'details', a dedicated Read button now
appears in the overlay top row so users can still open the reader
directly without changing their preference.
2026-06-13 11:40:53 -06:00
neon d42abb3647 fix(metadata): extract and save audiobook chapters and embedded metadata
The book dock metadata service now routes audio formats through the audio extractor to extract chapters, duration, narrators, and other embedded tags. This ensures that audiobook metadata is correctly mapped and persisted during the import process.

Closes #322
2026-06-13 17:18:40 +00:00
neon 702cb267ba fix(client): add enterkeyhint to ChipInput for mobile keyboards
Mobile keyboards, such as on Android, may not show a functioning
Enter key by default in this input. Adding enterkeyhint="enter"
allows users to properly submit chips like authors in the
metadata editor.

Closes #310
2026-06-13 16:54:41 +00:00
neon 873f890d20 fix(client): respect device orientation lock in pwa
The `orientation: 'any'` setting in the manifest forces the PWA to rotate even if the device is locked. Removing it restores native behavior.

Closes #309
2026-06-13 16:50:13 +00:00
neon 5aace0b49e feat(collections): reword message when adding an item to a collection
The previous 'already here' message was confusing when immediately adding an item to a collection, making it seem like the action didn't just occur. The confirmation has been updated to clarify that the item was just added.

Closes #306
2026-06-13 16:47:30 +00:00
neon a0e6850d69 refactor(books): remove bulk tags dialog and add individual edit action
The standalone BulkUpdateTagsDialog and its related state have been
removed from the table shell and views. In its place, a new
handleEditIndividually action was added, allowing users to select
multiple books and open the first one in the detail view for sequential
editing. The SelectionActionBar was also updated to support this action
and display query-scoped selection states.
2026-06-13 16:20:42 +00:00
neon b48dac0e30 refactor(books): update book window to use slots
Modify book navigation composables to work with sparse subsets
by pairing loaded book IDs with their absolute position in the
full listing. This ensures books reached via the jump rail
maintain their true position even when windowed.

Closes #319
2026-06-13 04:19:25 +00:00
neon 4f4189281c feat(books): support details preference in cover card overlay
When the user preference for thumbnail clicks is set to 'details', the
primary overlay button on book cards now routes to the book details
page and displays a BookText icon instead of the reader icon.

Also replaced the ExternalLink icon with BookText across dropdown
menus and settings for better visual consistency.
2026-06-12 18:40:09 +00:00
neon 5d0b5143fc fix(cover): resolve spine sizing and consistency issues
Delay spine layer rendering for blurred-fit covers until the image ratio is known so it does not overflow the artwork. Enable spine overlays on series stack cards, series detail headers, and carousels where they were previously disabled. Apply data attributes to spine layers so standalone artwork elements render properly without surface ancestors.

Closes #294
2026-06-12 05:43:12 +00:00
neon b81ba163ce fix(scanner): fallback to original filename when title is missing in patterns
The default upload file naming patterns for single file and folder per book previously relied exclusively on the title. If multiple files lacked a title, they would map to the same path. This changes the default patterns to fall back to the original filename if the title is missing, preventing files without metadata from clumping.

Closes #308
2026-06-12 05:27:59 +00:00
neon 280aad0712 refactor(books): replace cover loading placeholder with simple skeleton
Simplify the loading state for book covers by removing the complex BookCoverPlaceholder in favor of a neutral pulsing skeleton. This ensures a cleaner visual experience while the actual cover image is being loaded.
2026-06-12 05:20:38 +00:00
neon b1dff917ad feat(books): add jump rail navigation to book listings (#318)
Add server-backed jump buckets so large library, collection, and smart-scope listings can jump directly to sorted sections without loading every row up front.

Closes #163
2026-06-11 23:16:58 -06:00
neon 43e417b66e style(client): make edit metadata action buttons icon-only on narrow screens
Update the action buttons in the Edit Metadata tab to hide their text
labels on small screens. The buttons are kept horizontally scrollable on
mobile but wrap to the next line on desktop viewports. This ensures the
Save button and other actions are easily accessible without consuming
excessive vertical space on mobile devices.

Closes #292
2026-06-09 18:39:19 +00:00
neon c8401f2fa4 fix(reader): ignore keyboard shortcuts in shadow dom inputs
Keyboard events bubbling up from within a shadow DOM (such as the PDF
viewer's embedded find bar) report the custom element host as the event
target rather than the inner input field. This caused the reader's
global shortcuts to incorrectly trigger while typing.

Resolved by checking e.composedPath() to determine the true origin
of the event.

Closes #291
2026-06-09 18:18:21 +00:00
neon 9efd48c72b fix(reader): add floating back button to exit pdf viewer
The PDF reader lacked an exit button, trapping users. Since the native PDF viewer header is packed with tools and difficult to safely inject into, a floating action button (FAB) is added to the bottom left of the screen.

Closes #290
2026-06-09 18:08:49 +00:00
neon e07e3dac7b feat(books): add send via email action to details page
The details page now includes a 'Send via Email' button in the more options menu if the user has the email_send permission. Selecting it opens the SendBookDialog.

Closes #289
2026-06-09 03:10:50 +00:00
neon d9f3f31503 refactor(auth): split OidcCleanupService into service and job
Extract DB deletion logic into OidcCleanupService as a pure method
returning counts. Move the @Cron trigger, logging, and error handling
into a new OidcCleanupJob, matching the AuditCleanupJob pattern.
2026-06-08 22:53:44 +00:00
neon 69c09c5849 feat(metadata): import cover image from OPF sidecar guide and manifest
Sidecar OPF files can link to a sibling cover image, but the extractor
always passed null for the cover buffer, silently dropping the image.

Parse coverHref from three sources in priority order:
1. EPUB2 <guide><reference type="cover" href="..."/>
2. EPUB3 <manifest><item properties="cover-image" href="..."/>
3. Calibre <meta name="cover" content="id"/> resolved via manifest

Resolve the href relative to the OPF file directory and read the image
file. Fall back to null cover if the file is missing or unreadable,
so a broken cover link does not fail the import.

Closes #273
2026-06-08 22:27:00 +00:00
neon 058555b765 fix(auth): surface actionable error when OIDC issuer resolves to private address
The SSRF guard was throwing a generic 'URL host is not allowed' with no
indication that the block was due to a private or local IP, or how to
resolve it. Users with a LAN-hosted OIDC provider had no way to diagnose
the failure.

Introduce PrivateAddressException extends BadRequestException in ssrf.utils
so callers can distinguish private-address blocks from other validation
errors. The OIDC connection test catches it and re-throws with a message
that names OIDC_ALLOW_LOCAL_ISSUERS=true as the fix.

Closes #264
2026-06-08 22:00:36 +00:00
neon a1b417ccb8 chore(kobo): fix invalidateSnapshot log format and remove unbounded bookIds field
The debug log in invalidateSnapshot did not follow the project logging
convention ([event] [phase] key=value ... - message) and logged all
reset book IDs, which could produce unbounded single-line output for
large libraries.

Fix the event name, add the [end] phase marker, add durationMs, drop
the bookIds field, and remove the no-snapshot early-return log (noisy
no-op path).
2026-06-08 21:48:21 +00:00
Logan Selley 9de47fe67d fix(kobo): enhance kobodeviceservice to manage device snapshots (#277)
* fix(kobo): enhance kobodeviceservice to manage device snapshots

Refactor KoboDeviceService to include a syncService for invalidating user snapshots when devices are created or revoked. Update tests to verify snapshot invalidation behavior and ensure proper service instantiation. This change improves the synchronization process for user devices in the Kobo ecosystem.

* test(kobo): update device revocation tests for snapshot invalidation

Enhance the test cases for the KoboDeviceService's revokeDevice method to verify that the syncService's invalidateSnapshot is called correctly and that database deletion methods are invoked the expected number of times. This ensures accurate testing of device revocation behavior and snapshot management.

---------

Co-authored-by: Logan-Selley <logan@selleytech.com>
Co-authored-by: neon <18559658+neonsolstice@users.noreply.github.com>
2026-06-08 15:45:13 -06:00
neon a54108b97d fix(series): keep startup alive when series backfill fails (#271)
* fix(series): keep startup alive when series backfill fails

The series id backfill ran inside SeriesIdentityService.onModuleInit
without any error handling, so any failure rejected the lifecycle hook
and aborted NestApplication bootstrap, leaving the app unable to start.
On databases where the book_series unique arbiter index is missing or
unusable, the backfill INSERT ... ON CONFLICT throws and bricks startup.

Wrap the backfill in a guard so failures are logged and startup
continues, and surface the underlying driver error (Drizzle hides the
real cause behind its 'Failed query' wrapper) so the root DB issue is
diagnosable from logs.

Closes #270

* fix(series): resolve series backfill timeout on large libraries

The NodePg pool has statement_timeout: 30_000 ms, which is the right
guard for API queries but too aggressive for the one-time startup
backfill. On libraries with 100k+ books the bulk UPDATE against
book_metadata hits the limit before completing, leaving series_id
NULL for all books and repeating the timeout on every subsequent
restart.

Two changes:

1. Wrap the backfill in a transaction and issue SET LOCAL
   statement_timeout = 0 at the start. SET LOCAL scopes the change to
   this transaction only, so the pool timeout applies to every other
   query unchanged. The transaction also makes all three backfill
   statements atomic: previously a successful INSERT followed by a
   timed-out UPDATE left book_series populated but series_id still
   NULL everywhere.

2. Add a functional B-tree index on lower(btrim(series_name)) in
   book_metadata. The backfill UPDATE joins on that expression; without
   an index the planner falls back to a full sequential scan and hash
   join on every startup. With the index, subsequent startups use a
   nested-loop index scan that short-circuits immediately when no rows
   need updating.

Measured on 250k books: first migration completes without timeout;
subsequent startups finish the no-op check in ~150ms.

Closes #270
2026-06-08 15:32:11 -06:00
neon c0a7aef075 feat(books): add file upload UI to book detail files tab 2026-06-08 20:44:43 +00:00
neon 8bee4905bb feat(book): implement file rename and delete interactions
- Adds rename and delete file capabilities to Book Details > Files tab
- Automatically promotes a fallback file to primary upon deletion
- Refactors path update logic to correctly apply db folder path updates
- Ensures file type format badges in header search use global format colors
- Replaces legacy file property overrides with rename-only DTO

Closes #214
2026-06-08 14:36:29 -06:00
neon 638e5f15df fix: select format in findAllBookFiles 2026-06-08 05:42:08 +00:00
neon e62cb743ac fix(scanner): treat pt ## audiobook subfolders as part folders
The scanner disc directory pattern previously recognized cd, disc, disk, part, and side, but not pt. This caused Pt subfolders to be treated as separate books instead of being merged into the parent audiobook. This change adds pt as an accepted disc/part folder prefix.

Closes #262
2026-06-07 23:37:31 -06:00
neon f54752568f fix(library): rename all book files during metadata write
Ensure all files associated with a book are renamed or moved when the
primary file is renamed. Previously, the rename service only computed
new target paths for the primary file, abandoning companion files (e.g.,
covers, sidecars) or failing to rename them properly.

Compute new target paths for all content and secondary files, manage
batch rollbacks on failure, and handle internal naming collisions. Clean
up unused single-file rename repository and service methods.

Closes #265
2026-06-07 23:37:31 -06:00
Logan Selley d8e84aa531 feat(kobo): sync star ratings from ratebook analytics events (#269)
* feat(kobo): handle ratebook events in koboanalyticsservice

This commit adds the BookModule to the KoboModule imports, allowing for better integration with book-related functionalities. Additionally, the KoboAnalyticsService has been updated to handle 'RateBook' events, enabling the processing of user ratings through the new bookService. Tests have been added to ensure the correct handling of these events and their interactions with the reading session service.

* test(kobo): fill ratebook testing gaps

---------

Co-authored-by: Logan-Selley <logan@selleytech.com>
Co-authored-by: neon <18559658+neonsolstice@users.noreply.github.com>
2026-06-07 23:33:23 -06:00
neon d9788e8034 fix(client): use local timezone for reading session timeline 2026-06-08 04:46:59 +00:00
neon 3e4fc7706a fix(collections): allow focus in teleported icon picker search box
prevent focusout events on the sheet container from bubbling up to the document to bypass the focus scope trap. this allows the icon picker search box to retain focus when opened from the collection sheet. also increase the tooltip z-index to appear above the teleported panel.

Closes #280
2026-06-08 04:41:32 +00:00
neon 54ca05ef04 fix(opds): strip xml 1.0 illegal control characters from metadata
Remove invalid XML 1.0 characters from book metadata. These characters can cause lenient OPDS clients like KOReader to incorrectly parse the feed and shift entry boundaries onto the wrong acquisition link.

Closes #260
2026-06-06 22:21:39 +00:00
neon 0d6a27331e build(deps): bump golang.org/x/text in kepubify to fix CVEs
The kepubify binaries contained golang.org/x/text v0.3.6 which
triggers CVE-2021-38561 and CVE-2022-32149 in Trivy. This commit
updates the module to the latest version and rebuilds the binaries.
2026-06-06 22:09:16 +00:00
neon d60bcac4b0 build(deps): update kepubify binaries to go 1.26.4
The previous kepubify binaries were built with an older Go version
that triggered Trivy's CVE-2026-42504 vulnerability in the standard
library. This updates the binaries to the latest Go version to resolve
the CI pipeline failure.
2026-06-06 21:54:09 +00:00
neon 204f69b046 feat(metadata): add fetch pipeline diagnostics
The metadata fetch pipeline now gathers and returns detailed diagnostics
about provider selection, candidate results, and the reason for empty
resolved fields (e.g. no active providers, throttled providers, or no
candidates). These diagnostics are logged to improve observability and
make debugging metadata fetch failures significantly easier.
2026-06-06 19:32:34 +00:00
neon cb2a7b7f48 fix(kobo): capture paired analytics progress
Use paired Kobo open and leave analytics events to derive progress deltas and active reading time.

Format negative reading-log deltas without an extra plus sign.
2026-06-06 18:42:43 +00:00
neon feec3c794a fix(koreader): trigger hardcover auto-sync on progress update
KOReader progress updates were updating the database but failing to
emit the progress changed event, causing Hardcover auto-sync to be
skipped. This change adds the missing event emission to the KOReader
service so that external syncs trigger correctly, and patches a query
filter issue in the Hardcover repository.

Closes #258
2026-06-06 18:16:48 +00:00
neon 04a4fdd0eb fix(server): handle stream errors when patching zip archives
Add an error event listener to the source stream when appending entries during zip patching to prevent unhandled ENOENT errors from crashing the Node process.

Closes #226
2026-06-06 18:16:48 +00:00
neon 84ae6b19ca feat(books): link authors on book details to author page
Closes #252
2026-06-06 18:16:48 +00:00
neon 9757956e79 fix(client): fix chip input placeholder logic and styling
The placeholder property now correctly uses the provided value or falls
back to instructional text based on whether items exist. The placeholder
text opacity is also reduced.

Closes #251
2026-06-06 18:16:48 +00:00
neon 329d1b6643 feat(metadata): add Kobo metadata provider
Add Kobo as a first-class metadata source so books can keep Kobo IDs across fetch, edit, import, scoring, and file-write flows. Provide the Python cloudscraper setup needed for production fetches while keeping local setup explicit.

Closes #247
2026-06-06 18:16:47 +00:00
Logan Selley 81e0531ece feat(kobo): sync native reading sessions from analytics events (#245)
* feat(kobo): integrate analytics service into kobodevicecontroller

- added analytics service to the kobodevicecontroller to handle analytics events.
- updated the analyticsevent method to process incoming events and handle errors gracefully.
- enhanced unit tests to cover new analytics functionality, including successful ingestion and error handling scenarios.
- updated module imports to include the new analytics service and resolver.

* test(architecture): add kobo analytics resolver service to architecture boundaries tests

* refactor(kobo): enhance analytics handling and improve tests

- Updated KoboDeviceController to include analyticsService in constructor and added test for handling non-Error rejections.
- Enhanced KoboAnalyticsResolverService tests to cover scenarios where book rows do not exist and when primary file IDs are set without corresponding EPUB files.
- Modified KoboAnalyticsService to integrate bookIdentityService for resolving volume IDs and added tests for various edge cases in event ingestion, including handling invalid timestamps and logging warnings for non-Error exceptions.

These changes improve the robustness of analytics processing and ensure comprehensive test coverage for new functionalities.

* fix(kobo): enhance leavecontent event validation and update tests

- Improved validation logic in KoboAnalyticsService for LeaveContent events to ensure volume ID is a non-empty string.

---------

Signed-off-by: Logan Selley <37816781+Logan-Selley@users.noreply.github.com>
Co-authored-by: Logan-Selley <logan@selleytech.com>
Co-authored-by: neon <18559658+neonsolstice@users.noreply.github.com>
2026-06-06 12:12:41 -06:00
dependabot[bot] 642a8a5075 chore(deps): bump the production-dependencies group with 4 updates (#244)
Bumps the production-dependencies group with 4 updates: [@tanstack/vue-virtual](https://github.com/TanStack/virtual/tree/HEAD/packages/vue-virtual), [dompurify](https://github.com/cure53/DOMPurify), [reka-ui](https://github.com/unovue/reka-ui) and [nodemailer](https://github.com/nodemailer/nodemailer).


Updates `@tanstack/vue-virtual` from 3.13.26 to 3.13.28
- [Release notes](https://github.com/TanStack/virtual/releases)
- [Changelog](https://github.com/TanStack/virtual/blob/main/packages/vue-virtual/CHANGELOG.md)
- [Commits](https://github.com/TanStack/virtual/commits/@tanstack/vue-virtual@3.13.28/packages/vue-virtual)

Updates `dompurify` from 3.4.7 to 3.4.8
- [Release notes](https://github.com/cure53/DOMPurify/releases)
- [Commits](https://github.com/cure53/DOMPurify/compare/3.4.7...3.4.8)

Updates `reka-ui` from 2.9.8 to 2.9.9
- [Release notes](https://github.com/unovue/reka-ui/releases)
- [Commits](https://github.com/unovue/reka-ui/compare/v2.9.8...v2.9.9)

Updates `nodemailer` from 8.0.9 to 8.0.10
- [Release notes](https://github.com/nodemailer/nodemailer/releases)
- [Changelog](https://github.com/nodemailer/nodemailer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodemailer/nodemailer/compare/v8.0.9...v8.0.10)

---
updated-dependencies:
- dependency-name: "@tanstack/vue-virtual"
  dependency-version: 3.13.28
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
- dependency-name: dompurify
  dependency-version: 3.4.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
- dependency-name: reka-ui
  dependency-version: 2.9.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
- dependency-name: nodemailer
  dependency-version: 8.0.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: neon <18559658+neonsolstice@users.noreply.github.com>
2026-06-05 09:42:45 -06:00
dependabot[bot] 9f1563068f chore(deps): bump actions/checkout in the github-actions group (#243)
Bumps the github-actions group with 1 update: [actions/checkout](https://github.com/actions/checkout).


Updates `actions/checkout` from 6.0.2 to 6.0.3
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/de0fac2e4500dabe0009e67214ff5f5447ce83dd...df4cb1c069e1874edd31b4311f1884172cec0e10)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: neon <18559658+neonsolstice@users.noreply.github.com>
2026-06-05 09:42:38 -06:00
neon 913dab0ac5 feat(kobo/koreader): two way page level sync between kobo/koreader and bookorbit (#250)
* feat(kobo): support two-way progress sync

Implement two-way page-level reading progress synchronization between Kobo devices, KOReader, and BookOrbit. This ensures readers can switch between physical devices and the web app without losing their exact page-level reading position.

Closes #249

* fix(settings): restore thumbnail click preference

Restore the main branch thumbnail-click setting after the Kobo branch accidentally dropped it during the rebase. Keep the Kobo architecture allowlist aligned with the new identity service.

* fix(kobo): harden two-way progress sync fallbacks

Preserve Kobo bookmark metadata and tolerate null auth payloads/settings failures.

Cover review-reported regressions with focused tests.
2026-06-05 09:30:25 -06:00
neon cc7ab54a3b feat(settings): add option to change default thumbnail click behavior
Introduce a new display preference to control what happens when clicking
a book cover thumbnail. Users can now choose to open the book details
page instead of launching the reader directly.

Closes #240
2026-06-05 04:19:26 +00:00