From 113a5ded38edb4736f50fca6f0a66724a090d4df Mon Sep 17 00:00:00 2001 From: BoulderBadgeDad Date: Wed, 17 Jun 2026 20:56:45 -0700 Subject: [PATCH] Fix: + Wish silently failed on playlist detail pages (no channel context -> 400) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The per-video + Wish derived its channel from data._channel, which only exists on CHANNEL pages — on a playlist detail page it's data._playlist, so the add posted no youtube_id and the endpoint 400'd (button reverted, nothing happened). Now it falls back to the playlist's owner channel (channel_id/title, else the playlist itself) so wishing a video works on playlist pages too. --- webui/static/video/video-detail.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/webui/static/video/video-detail.js b/webui/static/video/video-detail.js index e47b399f..689ebce2 100644 --- a/webui/static/video/video-detail.js +++ b/webui/static/video/video-detail.js @@ -1619,7 +1619,14 @@ }; if (on) yc.removeWish('video', id).then(function (d) { setOn(!(d && d.success)); }).catch(function () { btn.disabled = false; }); else { + // Channel pages carry _channel; playlist pages carry _playlist — fall back + // to the playlist's owner channel so + Wish works there too (was a 400). var ch = (data && data._channel) || {}; + if (!ch.youtube_id && data && data._playlist) { + var pl = data._playlist; + ch = { youtube_id: pl.channel_id || pl.playlist_id, title: pl.channel_title || pl.title || 'Playlist', + avatar_url: pl.thumbnail_url }; + } yc.addVideos({ youtube_id: ch.youtube_id, title: ch.title, avatar_url: ch.avatar_url }, [ytVideoMap[id] || { youtube_id: id, title: '' }]) .then(function (d) { setOn(!!(d && d.success)); if (d && d.success && typeof showToast === 'function') showToast('Added to wishlist', 'success'); })