feat: Per-user Hardcover list/status sync (issue #60)#71
Merged
Conversation
Users can now link their own Hardcover API token and configure which sources to watch (to-read status and/or custom lists). A background job (every 6h) auto-requests any new books found for all enabled users. - Add UserHardcoverSync model and migration (036) - Add /api/hardcover-sync router (GET/PUT config, GET lists, POST run) - Add sync_hardcover_lists and sync_hardcover_lists_for_user tasks - Register sync_hardcover_lists as a scheduled job (6h default) - Respects per-user permissions and auto-approve settings - Frontend: Hardcover Sync card on Profile page with token input, toggles for to-read/lists, format preference, and manual sync button
Users no longer need to re-enter the app-wide Hardcover API token on their profile. The sync feature uses the global token automatically and shows 'Using app-wide Hardcover token' in the UI. A personal token is still accepted as an optional override for multi-user setups where different users have different Hardcover accounts.
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.
Summary
sync_hardcover_lists) runs every 6h to auto-request books from each user's configured sourcescan_request_ebook,can_request_audiobook,auto_approve_*)Backend changes
backend/alembic/versions/036_add_user_hardcover_sync.py— migration foruser_hardcover_synctablebackend/app/models.py—UserHardcoverSyncmodelbackend/app/routers/hardcover_sync.py— new router:GET/PUT /api/hardcover-sync/config,GET /api/hardcover-sync/lists,POST /api/hardcover-sync/runbackend/app/tasks.py—sync_hardcover_lists_for_user(user_id)andsync_hardcover_lists()global jobbackend/app/scheduler.py+backend/app/routers/jobs.py— register job with 6h default intervalbackend/main.py— register new routerFrontend changes
src/lib/api.ts—hardcoverSyncApiclient +HardcoverSyncConfig/HardcoverListtypessrc/pages/Profile.tsx— Hardcover Sync card with token input, enable toggle, to-read toggle, list multi-select, format picker, last-synced display, and manual Sync Now buttonTest plan