diff options
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/transport.js')
| -rw-r--r-- | packages/meshbay-hub/src/meshbay_hub/static/transport.js | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/transport.js b/packages/meshbay-hub/src/meshbay_hub/static/transport.js index d6a28d9..5a6e36b 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/transport.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/transport.js @@ -73,7 +73,7 @@ function _aborted() { // list is what lets a response two steps later be tied back to the right // one. const ADMIN_OP_TYPES = new Set([ - 'tmdb_override', 'tmdb_config', 'tmdb_enabled', 'video_root', 'audio_root', + 'tmdb_override', 'tmdb_rematch', 'tmdb_config', 'tmdb_enabled', 'video_root', 'audio_root', 'photo_roots', 'musicbrainz_enabled', 'file_delete', 'dir_delete', 'member_upload', 'apps_enabled', 'set_scan_settings', 'member_revoke', @@ -916,6 +916,22 @@ class MeshBayTransport { } /** + * Drop one file's cached TMDB match so it re-resolves with the node's + * current matcher (§10.1/V13) — the one-click alternative to the full + * search-and-pick flow. Signed for the same reason as overrideTmdbMatch. + */ + async rematchTmdbMatch(fileId, signFn) { + const msg = await this._sendAndWait({ + type: 'tmdb_rematch', v: '0.7', file_id: fileId, + }); + if (msg.type === 'error') throw new Error(msg.detail); + if (msg.type === 'admin_challenge') { + return this._authorizeAdminOp(msg, 'tmdb_rematch', `file_id=${fileId}`, signFn); + } + return msg; + } + + /** * Set/clear a custom TMDB API token, and/or set the language TMDB is * queried in (e.g. "fr-FR") — one for the whole node, since both are one * operator's shared credential/cache, not a per-group concern (see @@ -2032,6 +2048,11 @@ class MeshBayTransport { fileId: msg.file_id || '', tmdbId: msg.tmdb_id || '', mediaType: msg.media_type || '', }); } + // Same shape: the operator dropped one file's match to have it + // re-resolved (§10.1/V13). No tmdbId — the node re-derives it. + if (msg.type === 'tmdb_rematch_ack' && this._onTmdbOverride) { + this._onTmdbOverride({ fileId: msg.file_id || '', tmdbId: '', mediaType: '' }); + } // Same shape: the operator changed which folder is the Videos app's // entry point for this group. |