feat(matching): track detected books without a companion - #130
Open
serabi wants to merge 3 commits into
Open
Conversation
Reading Activity inbox (renamed from Currently Reading) forced every detected book through companion pairing, dead-ending ebook-only reads. - Rename nav/page to Reading Activity; dashboard banner now says 'Untracked books in progress' - Add track_solo intake action: ABS detections import audio-only, KoSync/Grimmory-ebook/Storyteller import ebook-only - Extend import_ebook_only with kosync_doc_id for hash-detected docs - Resolve detected rows by true identity after solo tracking - Solo-track buttons on pairing cards and review page
…orted solo option Addresses macroscopeapp review findings: - High: import_ebook_only inserted a Book without claiming the KoSync document, so concurrent requests could create duplicate books sharing one hash. Hashed paths now use save_book_with_kosync_ownership and return 409 when another request owns the document. - Medium: the review page rendered 'Track as audiobook only' for Grimmory audiobook detections that _post_track_solo always rejects. The block is now gated on solo_track_supported.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Two issues with the Currently Reading inbox:
_post_pairing_reviewhas no other path), so a book you'll only ever read as an ebook hit a wall: pair an audiobook you don't have, dismiss it (untracked), or hunt through Add Book yourself — even thoughimport_ebook_onlyandimport_audio_onlyalready existed in the intake module.Changes
/suggestions, removing the collision with the dashboard's Currently Reading section. Empty-state and dismiss-confirm copy updated to match.track_solointake action (matching_bp.py:_post_track_solo) routes by detection source:import_audio_only(live title/duration/author lookup)import_ebook_only(kosync_doc_id=...)import_ebook_onlyimport_ebook_onlyacceptskosync_doc_id— hash-detected Kobo docs have no filename to compute one from.{instance}:{id}:{fileId}don't match the{instance}:{filename}keyimport_ebook_onlyresolves internally, so cards would otherwise linger.Testing
1360 passed, 2 skipped (pre-existing).
ruff checkclean.Note
Add solo-track flow for detected books without a companion and rename 'Currently Reading' to 'Reading Activity'
_post_track_solohandler in matching_bp.py so users can track a single detected format without pairing — supports ABS audio-only imports, and ebook-only imports from KoSync, Storyteller, and Grimmory (whenebook_filenameexists)BookIntakeService.import_ebook_onlyin book_intake_service.py to acceptkosync_doc_iddirectly; when present, saves viasave_book_with_kosync_ownershipand returns 409 onKoSyncOwnershipConflictinstead of falling back tosave_booksolo_track_supportedflag to the match page context, disabled for Grimmory audiobooks; adds solo-track buttons in match.html and suggestions.htmlimport_ebook_onlyno longer callsensure_kosync_documentunconditionally; whenkosync_doc_idis present the save is atomic with ownership and may return 409 on conflict, whereas storyteller-only imports still use plainsave_bookMacroscope summarized 6f5da49.