diff --git a/webui/static/video/video-detail.js b/webui/static/video/video-detail.js index 2f4d32c9..471e8098 100644 --- a/webui/static/video/video-detail.js +++ b/webui/static/video/video-detail.js @@ -317,7 +317,21 @@ function renderActions(d) { var a = q('[data-vd-actions]'); if (!a) return; - var watching = !!d.monitored; + // The watchlist eye applies only to airing shows (movies + ended shows are + // terminal — they get acquisition, not a "watch for new" follow). + var isAiringShow = d.kind === 'show' && d.tmdb_id && (!window.VideoGet || VideoGet.isAiring(d.status)); + var watching = !!d._vw_watched; + // Lazily resolve the real watched state once (airing library shows are on + // by default), then re-render — see the new curated watchlist system. + if (isAiringShow && d.source !== 'tmdb' && !d._vw_checked && window.VideoWatchlist) { + d._vw_checked = true; + fetch('/api/video/watchlist/check', { method: 'POST', headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ kind: 'show', tmdb_ids: [d.tmdb_id] }) }) + .then(function (r) { return r.ok ? r.json() : null; }) + .then(function (res) { + if (res && res.results) { d._vw_watched = !!res.results[String(d.tmdb_id)]; if (data === d) renderActions(d); } + }).catch(function () { /* keep default state */ }); + } var html = ''; // Primary CTA: play it on your media server (owned items; arrives with // extras). The logo IS the brand name — "Play on " (no redundant word). @@ -338,11 +352,13 @@ // Preview (tmdb, un-owned) items have no library row to monitor — acquisition // (add-to-watchlist / get-missing) lands with the downloads phase. if (d.source === 'tmdb') { a.innerHTML = html; return; } - html += - ''; + if (isAiringShow) { + html += + ''; + } if (d.kind === 'show') { // "Get Missing" filters the episode list (show-only) html += '