feat: store thumbnails in project mounts with legacy fallback
Lint / Lint (push) Successful in 31s
Tests / Go backend (push) Successful in 45s
Tests / Dashboard checks (push) Successful in 50s
Docker / Docker Build & Push (push) Successful in 5m9s

- Add thumbnail upload, lookup, deletion, and scratch-fetch helpers
- Distinguish missing mounts from other listing failures
This commit is contained in:
Gabriel20xx committed 2026-10-15 13:56:24 +00:00
1 parent 483a1a278b
commit 6aec03fb3d
16 files changed
+846 -126

No files matched your search

+6 -5
View File
@@ -198,9 +198,7 @@ func (c *Core) thumbnailMediaIdentifier(w http.ResponseWriter, r *http.Request,
return
}
if !strings.Contains(id, string(filepath.Separator)) && !strings.Contains(id, "/") {
thumbnailPath := "/thumbnails/" + id + ".jpg"
if exists, _, _, err := c.carrierNode.Probe(r.Context(), thumbnailPath); err == nil && exists {
c.carrierNode.Proxy(w, r, thumbnailPath)
if c.carrierNode.ProxyThumbnail(w, r, c.serviceName, id) {
return
}
}
@@ -212,8 +210,11 @@ func (c *Core) thumbnailMediaIdentifier(w http.ResponseWriter, r *http.Request,
WHERE m.media_key=$1 OR CAST(m.id AS TEXT)=$1
ORDER BY t.created_at DESC
LIMIT 1`, id).Scan(&thumbnailID); err == nil && SafeRelative(thumbnailID) {
c.carrierNode.Proxy(w, r, "/thumbnails/"+thumbnailID+".jpg")
return
// A row whose file CarrierNode no longer has falls through to the original image below,
// rather than proxying CarrierNode's 404.
if c.carrierNode.ProxyThumbnail(w, r, c.serviceName, thumbnailID) {
return
}
}
record, err := c.findMedia(r.Context(), id)
if err != nil || !isImagePath(record.FilePath) {