summaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/video-app.js16
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">