From e141e3dcbd83b290f68dbd8b21b3a40eddb57e7a Mon Sep 17 00:00:00 2001 From: BoulderBadgeDad Date: Wed, 17 Jun 2026 20:42:30 -0700 Subject: [PATCH] Playlist search result: standard 'Add to Watchlist' button (not 'Follow') MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The pasted-playlist chip used the YouTube 'Follow' toggle; swapped it for the app-standard watchlist button (library-artist-watchlist-btn — same look/wording used across video + music): + Add to Watchlist ↔ ✓ In Watchlist. The search toggle handler updates the icon/text spans + 'watching' class accordingly. No global handler keys off that class, so reusing it is purely cosmetic. --- webui/static/video/video-search.js | 13 +++++++++---- webui/static/video/video-youtube.js | 7 +++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/webui/static/video/video-search.js b/webui/static/video/video-search.js index 3ad21c19..73000d7d 100644 --- a/webui/static/video/video-search.js +++ b/webui/static/video/video-search.js @@ -262,20 +262,25 @@ } } - // Add / remove the resolved playlist chip to the watchlist. + // Add / remove the resolved playlist chip to the watchlist (standard watchlist button). + function setPlBtn(btn, on) { + btn.classList.toggle('watching', on); + var ic = btn.querySelector('.watchlist-icon'); if (ic) ic.textContent = on ? '✓' : '+'; + var tx = btn.querySelector('.watchlist-text'); if (tx) tx.textContent = on ? 'In Watchlist' : 'Add to Watchlist'; + } function togglePlaylistFollow(btn) { if (!lastPlaylist) return; - var on = btn.classList.contains('vyt-follow--on'); + var on = btn.classList.contains('watching'); btn.disabled = true; var done = function () { btn.disabled = false; document.dispatchEvent(new CustomEvent('soulsync:video-wishlist-changed')); }; if (on) { VideoYoutube.unfollowPlaylist(lastPlaylist.playlist_id).then(function () { - btn.classList.remove('vyt-follow--on'); btn.innerHTML = '+ Follow'; done(); + setPlBtn(btn, false); done(); }).catch(function () { btn.disabled = false; }); } else { VideoYoutube.followPlaylist(lastPlaylist).then(function (d) { if (d && d.success) { - btn.classList.add('vyt-follow--on'); btn.innerHTML = '✓ Following'; + setPlBtn(btn, true); if (typeof showToast === 'function') showToast('Added ' + lastPlaylist.title + ' to watchlist', 'success'); } diff --git a/webui/static/video/video-youtube.js b/webui/static/video/video-youtube.js index 0bd9e451..e1045a1b 100644 --- a/webui/static/video/video-youtube.js +++ b/webui/static/video/video-youtube.js @@ -127,8 +127,11 @@ '' + esc(pl.title) + '' + (sub.length ? '' + sub.join(' · ') + '' : '') + '' + - '' + + '' + ''; }