diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-08-29 18:30:30 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-08-29 18:30:30 +0200 |
| commit | 8de80b7e19738b716d9973c0b4ba3b42085f7359 (patch) | |
| tree | 87305a6977fabafa2f733044c4c0d776295626f3 /packages/meshbay-hub/src | |
| parent | 78eef92bfa3513a81ac64d4377f8300c533aaa6c (diff) | |
| parent | 32318a64b12c83429c156a36c228769492e41d4e (diff) | |
| download | meshbay-8de80b7e19738b716d9973c0b4ba3b42085f7359.tar.gz | |
Merge branch 'fix/media-meta-unenriched-guard'
Diffstat (limited to 'packages/meshbay-hub/src')
| -rw-r--r-- | packages/meshbay-hub/src/meshbay_hub/static/video-app.js | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/video-app.js b/packages/meshbay-hub/src/meshbay_hub/static/video-app.js index 6d13e27..50fbcf6 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/video-app.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/video-app.js @@ -213,7 +213,13 @@ function bumpThumbGeneration() { for (const fn of _thumbRetryListeners) fn(); } -function useMediaMeta(transportRef, fileId, active) { +// `enrichSig` — a value that changes when the entry's index-time +// enrichment lands (display_title fills in). The node answers confidence 0 +// for a not-yet-enriched video (it can't tell it apart from a movie and +// would otherwise storm TMDB with its raw filename), so the client must +// refetch once the enriched fields arrive on an index delta — the fileId +// (a content hash) never changes, so nothing else would trigger it. +function useMediaMeta(transportRef, fileId, active, enrichSig) { const [meta, setMeta] = useState(null); const [refetchToken, setRefetchToken] = useState(0); @@ -238,7 +244,7 @@ function useMediaMeta(transportRef, fileId, active) { } catch { if (!cancelled) setMeta({ confidence: 0 }); } })(); return () => { cancelled = true; }; - }, [fileId, active, refetchToken]); + }, [fileId, active, refetchToken, enrichSig]); return meta; } @@ -280,7 +286,7 @@ function useSeasonMeta(transportRef, tmdbId, season, active) { function PosterCard({ title, subtitle, repEntry, transportRef, gekRef, onOpen, groupKey, onMetaResolved }) { const tRef = repEntry._tRef || transportRef; const gRef = repEntry._gRef || gekRef; - const meta = useMediaMeta(tRef, repEntry.id, true); + const meta = useMediaMeta(tRef, repEntry.id, true, repEntry.display_title || ''); const confident = Boolean(meta && meta.confidence && meta.tmdb_id); const metaReady = meta !== null; @@ -708,7 +714,9 @@ function PosterGrid({ movies, shows, transportRef, gekRef, onPreview, tmdbEnable const openDetail = (title, repEntry, show, files) => setDetail({ title, repEntry, show, files }); const detailTRef = detail && detail.repEntry._tRef ? detail.repEntry._tRef : transportRef; const detailGRef = detail && detail.repEntry._gRef ? detail.repEntry._gRef : gekRef; - const detailMeta = useMediaMeta(detailTRef, detail ? detail.repEntry.id : null, !!detail); + const detailMeta = useMediaMeta( + detailTRef, detail ? detail.repEntry.id : null, !!detail, + detail ? (detail.repEntry.display_title || '') : ''); return html` <div class="video-grid"> |