diff options
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/video-app.js')
| -rw-r--r-- | packages/meshbay-hub/src/meshbay_hub/static/video-app.js | 25 |
1 files changed, 22 insertions, 3 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 48709f9..6d13e27 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/video-app.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/video-app.js @@ -482,8 +482,22 @@ function VideoDetailModal({ }) { const confident = Boolean(meta && meta.confidence && meta.tmdb_id); const [searching, setSearching] = useState(false); + const [rematching, setRematching] = useState(false); const mediaType = show ? 'tv' : 'movie'; + // §10.1/V13: drop this file's cached match on the node and let it + // re-resolve with the current matcher — the one-click alternative to the + // full search-and-pick flow above. + const doRematch = useCallback(async () => { + if (rematching) return; + setRematching(true); + try { + await transportRef.current.rematchTmdbMatch(repEntry.id, buildSignFn(transportRef)); + bumpMediaMetaGeneration(); + } catch { /* leave the current match in place */ } + setRematching(false); + }, [rematching, repEntry, transportRef]); + // Reset whenever a different file/show is opened in this same modal // instance — repEntry/show change identity, selectedSeason must not // silently keep pointing at whatever the previous show's season 4 was. @@ -535,9 +549,14 @@ function VideoDetailModal({ `} `} ${isNodeAdmin && html` - <button class="admin-btn video-fix-match" onClick=${() => setSearching(true)}> - ${t('video.fix_match')} - </button> + <div class="video-admin-actions"> + <button class="admin-btn video-fix-match" onClick=${() => setSearching(true)}> + ${t('video.fix_match')} + </button> + <button class="admin-btn" onClick=${doRematch} disabled=${rematching}> + ${rematching ? html`<span class="spinner"></span>` : t('video.rematch_one')} + </button> + </div> `} ${showMultiSeason && html` <${SeasonTabs} seasons=${show.seasons} selected=${selectedSeason} |