8000 fix: Thumbnail serving endpoint path resolution by tamzrod · Pull Request #81 · tamzrod/Librarian · GitHub
[go: up one dir, main page]

Skip to content

fix: Thumbnail serving endpoint path resolution - #81

Merged
tamzrod merged 1 commit into
mainfrom
fix/thumbnail-serving-path
Jul 2, 2026
Merged

tamzrod merged 1 commit into
mainfrom
fix/thumbnail-serving-path

Conversation

@tamzrod
@tamzrod tamzrod commented Jul 2, 2026
Copy link
Copy Markdown
Owner

Summary

Fixed the thumbnail serving endpoint to correctly serve thumbnails from /librarian-data/thumbnails/ instead of the old location.

Problem

GET /thumbnails/<filename> was returning HTTP 404 because the API was not correctly mapping browser requests to the filesystem location.

Solution

Modified /api/app.py to serve thumbnails from the correct directory:

# Before
thumbnail_full_path = Path(LIBRARIAN_DATA_ROOT) / path

# After  
thumbnail_full_path = Path(LIBRARIAN_DATA_ROOT) / "thumbnails" / path

Path Resolution

Component Value
Browser request /thumbnails/1018_IMG_20260607_072901_thumb.jpg
Filesystem path /librarian-data/thumbnails/1018_IMG_20260607_072901_thumb.jpg

Verification

  • curl http://localhost:8000/thumbnails/1018_IMG_20260607_072901_thumb.jpg returns HTTP 200
  • Explorer displays thumbnails
  • Trace displays thumbnails

Preserved

  • ✓ API contract: Browser request /thumbnails/<filename> unchanged
  • ✓ Library read-only: /library not touched
  • ✓ Catalog artifacts in Librarian-managed storage

@tamzrod can click here to continue refining the PR

The thumbnail API endpoint was not correctly mapping browser requests
to the filesystem location. Changed the path resolution to serve from
/librarian-data/thumbnails/ instead of directly from LIBRARIAN_DATA_ROOT.

API contract preserved: Browser request /thumbnails/<filename> unchanged.
@tamzrod
tamzrod marked this pull request as ready for review July 2, 2026 07:16
@tamzrod
tamzrod merged commit 7d2a662 into main Jul 2, 2026
3 of 7 checks passed
@tamzrod
tamzrod deleted the fix/thumbnail-serving-path branch July 6, 2026 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0