Skip to content

Conversation

@rerowep
Copy link
Contributor

@rerowep rerowep commented Jan 28, 2026

  • Add rero-invenio-thumbnails dependency for book cover retrieval
  • Configure RERO_INVENIO_THUMBNAILS_FILES_DIR in config.py
  • Fix Flask endpoint name: api_thumbnails.get_thumbnail
  • Fix URL parameter bug: weight → width

API Endpoints:

  • Add /cover/ API endpoint for cover image retrieval
    • Supports ISBN-10 and ISBN-13 formats
    • Accepts cached, width, and height query parameters
    • Returns JSON with thumbnail URL and metadata

Template Filters:

  • Add get_cover_art template filter for Jinja2 templates
    • Supports electronicLocator coverImage URLs
    • Falls back to ISBN-based thumbnail lookup
    • Handles multiple ISBNs in sorted order

CLI Commands:

  • Add add_cover_urls command to bulk process documents
    • Supports --commit flag for database persistence
    • Supports --cached/--no-cached for thumbnail caching
    • Supports --scroll for Elasticsearch timeout configuration
    • Supports --pids option for processing specific documents
    • Excludes documents already having cover images
    • Sorts PIDs numerically for consistent processing

Document Extensions:

  • Add AddCoverUrlExtension for automatic cover URL injection
    • Automatically adds cover URLs on document create/commit
    • Checks for existing cover images to avoid duplicates
    • Configurable caching support

Tasks:

  • Add add_cover_urls shared task for batch processing
    • Used by CLI command and can be called programmatically
    • Supports filtering by PIDs or processing all documents
    • Updates timestamp tracking for monitoring

@rerowep rerowep self-assigned this Jan 28, 2026
@github-actions github-actions bot added f: data About data model, importation, transformation, exportation of data, specific for bibliographic data dev: fixtures Fixtures data used for ils.test and ilsdev.test labels Jan 28, 2026
@rerowep rerowep force-pushed the wep-thumbnails branch 2 times, most recently from 0f32c29 to 131b619 Compare January 28, 2026 10:30
@rerowep rerowep force-pushed the wep-thumbnails branch 2 times, most recently from 970570f to d374a96 Compare February 5, 2026 13:00
* Upgrades urllib3 from 1.26.20 to 2.6.3 to resolve security
  vulnerabilities:
    - GHSA-pq67-6m6q-mj2v
    - CVE-2025-66418
    - CVE-2025-66471
    - CVE-2026-21441
* Updates pyproject.toml constraint from "urllib3 (<2.0.0)" to
  "urllib3 (>=2.6.0,<3.0.0)".
* Removes all vulnerability exceptions from scripts/test as they
  are now resolved (4 urllib3 CVEs) or patched (nbconvert CVE-2025-
  53000 fixed in 7.17.0).
* Also includes code quality fixes:
  - Fix pytest.raises to use context manager form (RUF061)
  - Format code with ruff

Co-Authored-by: Peter Weber <[email protected]>
@rerowep rerowep force-pushed the wep-thumbnails branch 2 times, most recently from 1296c99 to 333e2a7 Compare February 9, 2026 15:08
* Add rero-invenio-thumbnails dependency for book cover retrieval
* Configure RERO_INVENIO_THUMBNAILS_FILES_DIR in config.py
* Fix Flask endpoint name: api_thumbnails.get_thumbnail
* Fix URL parameter bug: weight → width

API Endpoints:
* Add /cover/<isbn> API endpoint for cover image retrieval
  - Supports ISBN-10 and ISBN-13 formats
  - Accepts cached, width, and height query parameters
  - Returns JSON with thumbnail URL and metadata

Template Filters:
* Add get_cover_art template filter for Jinja2 templates
  - Supports electronicLocator coverImage URLs
  - Falls back to ISBN-based thumbnail lookup
  - Handles multiple ISBNs in sorted order

CLI Commands:
* Add add_cover_urls command to bulk process documents
  - Supports --commit flag for database persistence
  - Supports --cached/--no-cached for thumbnail caching
  - Supports --scroll for Elasticsearch timeout configuration
  - Supports --pids option for processing specific documents
  - Excludes documents already having cover images
  - Sorts PIDs numerically for consistent processing

Document Extensions:
* Add AddCoverUrlExtension for automatic cover URL injection
  - Automatically adds cover URLs on document create/commit
  - Checks for existing cover images to avoid duplicates
  - Configurable caching support

Tasks:
* Add add_cover_urls shared task for batch processing
  - Used by CLI command and can be called programmatically
  - Supports filtering by PIDs or processing all documents
  - Updates timestamp tracking for monitoring

Co-Authored-by: Peter Weber <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev: fixtures Fixtures data used for ils.test and ilsdev.test f: data About data model, importation, transformation, exportation of data, specific for bibliographic data

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant