This repository was archived by the owner on Feb 2, 2026. It is now read-only.
[FEATURE] Multi-selection of books to shelf - #87#136
Open
Fail-Safe wants to merge 29 commits intogelbphoenix:mainfrom
Open
[FEATURE] Multi-selection of books to shelf - #87#136Fail-Safe wants to merge 29 commits intogelbphoenix:mainfrom
Fail-Safe wants to merge 29 commits intogelbphoenix:mainfrom
Conversation
Add code review for shelf count indicator PR
Add shelf count indicator and pills
…tion messages in the table
…s for improved user experience
[FEATURE] Multi-selection of books to shelf
…-shelf [FEATURE] Multi-selection of books to shelf
* chore: add ESLint v9 flat config (baseline) * chore: ignore lockfiles and drop package-lock * chore: ignore Node lockfiles * Add functionality for generated shelves and enhance shelf management - Introduced a new configuration option to generate and link shelves to a Calibre column in the config view. - Updated the detail, listenmp3, search, and shelf templates to exclude generated shelves from various shelf management actions. - Enhanced the shelf display logic to differentiate between generated and regular shelves, including tooltips and sorting options for generated shelves. - Improved the layout and accessibility of shelf links and actions in the navigation and shelf views. * Enhance configuration for cache directory and update docker-compose comments for CACHE_DIR environment variable. * Add DB index for fast thumbnail lookups in large libraries * Implement caching headers for book and series cover responses * Refactor thumbnail generation to handle duplicates and improve file management * Fix locale parsing to skip wildcards in accepted languages * Reorganize imports to satisfy pylint recommendations * Add runtime debug hooks via SIGUSR1 and SIGUSR2 for live CPU/memory investigations * Whitespace fixups for improving linter/formatter happiness and affording less noisy future commits * feat(kobo): Enhance Kobo sync functionality and UI - Added logging for book sync actions in `kobo_sync_status.py` to track sync reasons. - Implemented a local-only opt-in shelf for Kobo sync in `render_template.py`, ensuring it exists in hybrid mode. - Updated shelf creation logic in `shelf.py` to handle reserved shelf names for Kobo sync. - Improved JavaScript handling for dynamic form controls in `main.js`. - Added configuration options for Kobo collections sync in `config_edit.html`, allowing users to select sync modes. - Display generated shelves in the book detail view in `detail.html`. - Adjusted image loading resolution in `image.html` for better performance. - Introduced a new database model `KoboTagSyncState` in `ub.py` to manage sync states and settings. - Enhanced database migration logic to ensure necessary tables and columns exist. - Updated the book detail rendering logic in `web.py` to include generated shelves. * refactor: Remove unused import of itsdangerous * fix: Restore incorrectly removed imports * fix: Correct an ugly bug in handling of None state in change_archived_books function * feat(kobo): Add generated shelf sync settings and item limit configuration * feat: Implement Kobo sync collections mode and related settings - Added a new user setting for Kobo sync collections mode with options: "all", "selected", and "hybrid". - Introduced a confirmation modal for changing the Kobo sync mode, triggering a full resync on the next device connection. - Updated user edit and configuration templates to include new Kobo sync settings. - Created a new shelf table page with bulk actions for enabling/disabling Kobo sync and deleting selected shelves. - Implemented JavaScript functionality for managing shelf selections and handling bulk actions. - Migrated existing Kobo sync settings to new per-user fields in the database. - Removed deprecated global Kobo sync settings from the configuration template. * feat(kobo): Enhance Kobo sync functionality with metadata inspection and shelf management * Fix optional imports for dev/test * Kobo: improve sync robustness and add store merge toggle * feat(kobo): enhance remove_synced_book function to support user_id parameter and improve session handling * Cache writable Calibre DB copy for exports When the Calibre library DB is read-only, create a writable temp copy of metadata.db and set CALIBRE_OVERRIDE_DATABASE_PATH to point at it. The copy is cached (keyed by source mtime+size) and reused for a short TTL (60s) to avoid repeated copying. Best-effort only; falls back on error. Also reorganize imports and apply small refactors/cleanup across modules * Reorganize imports, reformat code, fix Kobo sync Gate shelf membership updates using tags_last_modified (the shelf/collection token) to avoid missing newly-allowed books. For generated shelves, rely on the "not yet synced" branch so older-but-newly-allowed books are emitted without a full reset.
* chore: add ESLint v9 flat config (baseline) * Add functionality for generated shelves and enhance shelf management - Introduced a new configuration option to generate and link shelves to a Calibre column in the config view. - Updated the detail, listenmp3, search, and shelf templates to exclude generated shelves from various shelf management actions. - Enhanced the shelf display logic to differentiate between generated and regular shelves, including tooltips and sorting options for generated shelves. - Improved the layout and accessibility of shelf links and actions in the navigation and shelf views. * Reorganize imports to satisfy pylint recommendations * Add runtime debug hooks via SIGUSR1 and SIGUSR2 for live CPU/memory investigations * feat(kobo): Enhance Kobo sync functionality and UI - Added logging for book sync actions in `kobo_sync_status.py` to track sync reasons. - Implemented a local-only opt-in shelf for Kobo sync in `render_template.py`, ensuring it exists in hybrid mode. - Updated shelf creation logic in `shelf.py` to handle reserved shelf names for Kobo sync. - Improved JavaScript handling for dynamic form controls in `main.js`. - Added configuration options for Kobo collections sync in `config_edit.html`, allowing users to select sync modes. - Display generated shelves in the book detail view in `detail.html`. - Adjusted image loading resolution in `image.html` for better performance. - Introduced a new database model `KoboTagSyncState` in `ub.py` to manage sync states and settings. - Enhanced database migration logic to ensure necessary tables and columns exist. - Updated the book detail rendering logic in `web.py` to include generated shelves. * fix: Restore incorrectly removed imports * feat(kobo): Add generated shelf sync settings and item limit configuration * feat: Implement Kobo sync collections mode and related settings - Added a new user setting for Kobo sync collections mode with options: "all", "selected", and "hybrid". - Introduced a confirmation modal for changing the Kobo sync mode, triggering a full resync on the next device connection. - Updated user edit and configuration templates to include new Kobo sync settings. - Created a new shelf table page with bulk actions for enabling/disabling Kobo sync and deleting selected shelves. - Implemented JavaScript functionality for managing shelf selections and handling bulk actions. - Migrated existing Kobo sync settings to new per-user fields in the database. - Removed deprecated global Kobo sync settings from the configuration template. * Kobo: improve sync robustness and add store merge toggle * Cache writable Calibre DB copy for exports When the Calibre library DB is read-only, create a writable temp copy of metadata.db and set CALIBRE_OVERRIDE_DATABASE_PATH to point at it. The copy is cached (keyed by source mtime+size) and reused for a short TTL (60s) to avoid repeated copying. Best-effort only; falls back on error. Also reorganize imports and apply small refactors/cleanup across modules * Reorganize imports, reformat code, fix Kobo sync Gate shelf membership updates using tags_last_modified (the shelf/collection token) to avoid missing newly-allowed books. For generated shelves, rely on the "not yet synced" branch so older-but-newly-allowed books are emitted without a full reset. * Enhance Kobo Sync functionality and update dependencies - Added support for retrieving user Kobo collections mode in `books_table` and `list_books` functions. - Implemented logic to determine if the user is in hybrid mode for Kobo sync and adjusted book entries accordingly. - Updated `change_profile` to handle Kobo remove behavior settings. - Removed unnecessary dependency on `python-magic-bin` from `uv.lock`. - Added `.DS_Store` and cache directories to `.gitignore` files for cleaner repository management. * feat(docker): update Dockerfile for improved dependency management and cleanup feat(scripts): add purge_kepubs.py for removing stale KEPUB files from Calibre library feat(dev): introduce dev-run.sh for automatic restart on code changes
Use COUNT(DISTINCT book.id) for pagination totals with a safe fallback. load_dependencies now reads .pip_installed for frozen builds and returns a simplified runtime list; legacy range checks removed and dependency_check() returns an empty list to avoid lockfile parsing. Consolidate frontend infinite-scroll: disable isotope grid, move shelf init to main.js, add shelf.js stub and enable load-more layout in templates. Also apply import reordering and various whitespace/formatting cleanups.
Installer now requires pyproject.toml + uv.lock and prefers uv for dependency installation. Add --extras / --all-extras / --no-extras flags to control optional integrations (default = all extras). The installer no longer falls back to pip-tools/requirements; it fails if uv sync cannot apply the lock. Update pyproject.toml and uv.lock: bump Flask-related packages, Flask-Limiter, flask-wtf; add python-magic-bin for Windows and use a patched rauth from a git source. Remove legacy requirements/optional files and adjust CI to watch pyproject.toml and uv.lock instead.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
Implements bulk shelf management allowing users to add or remove multiple selected books to/from shelves simultaneously from the Books List table. Addresses the need for efficient shelf management when organizing large book collections.
Type of Change
Areas Affected
Changes Made
Backend (
cps/shelf.py)MAX_BULK_SHELF_SELECTION = 1000limit to prevent performance issuesbulk_add_to_shelf()andbulk_remove_from_shelf()to enforce limit with i18n error messagesFrontend JavaScript (
cps/static/js/table.js)btI18n()for key lookups,btFormatNamed()for Python-style named placeholder formatting (%(key)s)Frontend JavaScript (
cps/static/js/main.js)confirmDialog()to accept optionaltextOverridesparameter for programmatic dialog text without AJAX callTemplates (
cps/templates/book_table.html)<span id="books-table-i18n">with data attributes containing all translatable strings__COUNT__,__SHELF__, etc.) in templates for JavaScript-side replacementaria-labelattributes)Documentation (
README.md)Example Usage
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Test Configuration
Screenshots/Video (if applicable)
N/A - Feature requires live environment interaction
Files/Formats Tested
If this change affects file handling, please list the formats and file types you tested:
Checklist
Additional Notes