diff --git a/webui/static/video/video-detail.js b/webui/static/video/video-detail.js index e56ba93a..0b673daf 100644 --- a/webui/static/video/video-detail.js +++ b/webui/static/video/video-detail.js @@ -167,7 +167,8 @@ meta.push('YouTube'); var yc = window.VideoYoutube; var subs = yc && yc.compactCount(d.subscriber_count); if (subs) meta.push('' + subs + ' subscribers'); - if (d.video_count != null) meta.push('' + esc(d.video_count) + ' videos'); + // NB: no "N videos" — YouTube doesn't expose a reliable total, and what we + // fetch is just the recent page (the cap), so showing it would mislead. var views = yc && yc.compactCount(d.view_count); if (views) meta.push('' + views + ' views'); if (d.handle) meta.push('' + esc(d.handle) + ''); var mm = q('[data-vd-meta]'); if (mm) mm.innerHTML = meta.join(''); @@ -1461,7 +1462,7 @@ else yc.follow({ youtube_id: ch.youtube_id, title: ch.title, avatar_url: ch.avatar_url }).then(function (d) { if (d && d.success) { data.following = true; renderActions(data); // toggle in place — no page reload - if (typeof showToast === 'function') showToast('Following · ' + (d.added_videos || 0) + ' videos added', 'success'); + if (typeof showToast === 'function') showToast('Added to watchlist', 'success'); document.dispatchEvent(new CustomEvent('soulsync:video-wishlist-changed')); } }).catch(function () { /* ignore */ }); diff --git a/webui/static/video/video-search.js b/webui/static/video/video-search.js index 8597d3e4..3a830811 100644 --- a/webui/static/video/video-search.js +++ b/webui/static/video/video-search.js @@ -248,7 +248,7 @@ if (d && d.success) { btn.classList.add('vyt-follow--on'); btn.innerHTML = '✓ Following'; if (typeof showToast === 'function') - showToast('Following ' + lastChannel.title + ' · ' + (d.added_videos || 0) + ' videos added', 'success'); + showToast('Added ' + lastChannel.title + ' to watchlist', 'success'); } done(); }).catch(function () { btn.disabled = false; }); diff --git a/webui/static/video/video-youtube.js b/webui/static/video/video-youtube.js index 4234469b..01205c65 100644 --- a/webui/static/video/video-youtube.js +++ b/webui/static/video/video-youtube.js @@ -106,7 +106,13 @@ body: JSON.stringify(body || {}) }).then(function (r) { return r.ok ? r.json() : null; }); } - function follow(channel) { return post('/api/video/youtube/follow', { channel: channel }); } + // Following a channel WATCHLISTS it (like a show) — it doesn't auto-wish all + // its videos, so we send only the channel fields, not its video list. + function follow(channel) { + var ch = channel || {}; + return post('/api/video/youtube/follow', + { channel: { youtube_id: ch.youtube_id, title: ch.title, avatar_url: ch.avatar_url } }); + } function unfollow(youtubeId) { return post('/api/video/youtube/unfollow', { youtube_id: youtubeId }); } function removeWish(scope, sourceId) { return post('/api/video/youtube/wishlist/remove', { scope: scope, source_id: sourceId });