|
| 1 | +.. |
| 2 | + Copyright (C) 2026 RERO. |
| 3 | +
|
| 4 | + rero-invenio-thumbnails is free software; you can redistribute it |
| 5 | + and/or modify it under the terms of the MIT License; see LICENSE file for |
| 6 | + more details. |
| 7 | + |
| 8 | +Changes |
| 9 | +======= |
| 10 | + |
| 11 | +Version 0.2.0 (unreleased) |
| 12 | +-------------------------- |
| 13 | + |
| 14 | +**Breaking Changes:** |
| 15 | + |
| 16 | +- **API Return Format Change**: All provider methods and `get_thumbnail_url()` now return |
| 17 | + a tuple `(url, provider_name)` instead of just the URL. This provides transparency about |
| 18 | + which provider supplied the thumbnail. |
| 19 | + |
| 20 | + Migration example:: |
| 21 | + |
| 22 | + # Old code (v0.1.0) |
| 23 | + url = get_thumbnail_url("9780134685991") |
| 24 | + |
| 25 | + # New code (v0.2.0+) |
| 26 | + url, provider = get_thumbnail_url("9780134685991") |
| 27 | + |
| 28 | +- **HTTP Response Format**: The `/thumbnails-url/<isbn>` endpoint now includes a `provider` |
| 29 | + field in the JSON response:: |
| 30 | + |
| 31 | + { |
| 32 | + "url": "https://covers.openlibrary.org/b/isbn/9780134685991-L.jpg", |
| 33 | + "isbn": "9780134685991", |
| 34 | + "provider": "open library" |
| 35 | + } |
| 36 | + |
| 37 | +**Improvements:** |
| 38 | + |
| 39 | +- **New endpoint**: Added `/thumbnails/<isbn>` endpoint to serve actual thumbnail image |
| 40 | + files directly from local storage (in addition to the existing `/thumbnails-url/<isbn>` |
| 41 | + endpoint that returns JSON with URLs) |
| 42 | +- **Client-side caching**: The `/thumbnails/<isbn>` endpoint now supports efficient |
| 43 | + client-side caching with ETag and Last-Modified headers, plus conditional requests |
| 44 | + (If-None-Match, If-Modified-Since) returning 304 Not Modified responses |
| 45 | +- Cache entries now store provider information using JSON format (prevents issues with pipe characters in URLs) |
| 46 | +- Use `RERO_INVENIO_THUMBNAILS_HTTP_CACHE_MAX_AGE` constant from config.py consistently |
| 47 | +- BNF and DNB providers now validate image content before returning URLs |
| 48 | +- Improved error handling with provider attribution in error tuples |
| 49 | +- Modernized exception handling using `contextlib.suppress` where appropriate |
| 50 | + |
| 51 | +**Bug Fixes:** |
| 52 | + |
| 53 | +- Fixed cache serialization to handle URLs containing pipe characters (`|`) by using JSON instead of pipe-delimited strings |
| 54 | + |
| 55 | +0.1.0 (2026-01-15) |
| 56 | +------------------- |
| 57 | + |
| 58 | +Initial release |
| 59 | + |
| 60 | +- Multi-provider thumbnail URL discovery system with fallback chain |
| 61 | +- Six thumbnail providers: |
| 62 | + - Files: Serve from local filesystem directory |
| 63 | + - Open Library: Free, community-driven book cover database |
| 64 | + - BNF (Bibliothèque nationale de France): French national library covers |
| 65 | + - DNB (Deutsche Nationalbibliothek): German national library covers via SRU |
| 66 | + - Google Books API: Official Google Books API integration |
| 67 | + - Google Books: Google Books preview service |
| 68 | +- Plugin-based architecture via entry points for custom providers |
| 69 | +- Redis-based caching via `invenio_cache` with configurable TTL |
| 70 | +- Flask blueprint with `/thumbnails-url/<isbn>` endpoint returning JSON |
| 71 | +- HTTP retry logic with exponential backoff for external providers |
| 72 | +- Configurable retry behavior via `RERO_INVENIO_THUMBNAILS_RETRY_*` settings |
| 73 | +- Environment variable `RERO_THUMBNAILS_DISABLE_RETRIES` to disable retries globally |
| 74 | +- Comprehensive test suite with 120 tests and 97% code coverage |
| 75 | +- Full Sphinx documentation with API reference and usage examples |
0 commit comments