8000 feat: Move thumbnail storage to Librarian-managed catalog by tamzrod · Pull Request #80 · tamzrod/Librarian · GitHub
[go: up one dir, main page]

Skip to content

feat: Move thumbnail storage to Librarian-managed catalog - #80

Merged
tamzrod merged 1 commit into
mainfrom
feature/thumbnail-storage-migration
Jul 2, 2026
Merged

tamzrod merged 1 commit into
mainfrom
feature/thumbnail-storage-migration

Conversation

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

Summary

Migrate thumbnail storage from /library/.thumbnails (user library) to /librarian-data/thumbnails (Librarian-managed catalog).

Philosophy

  • Original artifacts belong to the user — stored in /library
  • Derived artifacts belong to Librarian — stored in /librarian-data

A thumbnail is not part of the original file; it is part of the Librarian catalog. The library remains read-only.

Changes

File Change
environment.py Added get_librarian_data_root() function and DEFAULT_LIBRARIAN_DATA_ROOT = "/librarian-data"
workers/thumbnail_generator.py Store thumbnails in librarian_data_root instead of library root
api/app.py Serve thumbnails from LIBRARIAN_DATA_ROOT instead of LIBRARY_ROOT
deploy/docker-compose.yml Library mount: ro; Added librarian_data volume: rw

Architecture

/library (READ-ONLY - User files)
└── [original files untouched]

/librarian-data (READ-WRITE - Librarian catalog)
└── thumbnails/
    └── 1017_IMG_001_thumb.jpg

Database

No schema changes. Database continues to store relative paths:

thumbnails/1017_IMG_001_thumb.jpg

API

API contract unchanged. Frontend continues to request /thumbnails/...

Success Criteria

  • ✅ Original library remains untouched
  • ✅ Library mount is read-only (ro)
  • ✅ Derived artifacts stored in Librarian catalog
  • ✅ Only thumbnails/ folder created (future folders not implemented)

Verification

After deployment:

SELECT COUNT(thumbnail_path)
FROM documents
WHERE artifact_type='image';
-- Result should increase above zero

@tamzrod can click here to continue refining the PR

…humbnails

- Add LIBRARIAN_DATA_ROOT environment variable (default: /librarian-data)
- Update thumbnail_generator.py to store thumbnails in librarian data root
- Update API thumbnail endpoint to serve from librarian data root
- Change library mount from rw to ro in docker-compose.yml
- Add librarian_data volume for derived artifacts

Philosophy: Original artifacts belong to the user, derived artifacts
belong to Librarian. Thumbnails are part of the Librarian catalog.
@tamzrod
tamzrod marked this pull request as ready for review July 2, 2026 06:55
@tamzrod
tamzrod merged commit 379e58c into main Jul 2, 2026
3 of 7 checks passed
@tamzrod
tamzrod deleted the feature/thumbnail-storage-migration 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