diff --git a/js/channelProfile.js b/js/channelProfile.js index d20db4cf..396b6a50 100644 --- a/js/channelProfile.js +++ b/js/channelProfile.js @@ -1824,6 +1824,11 @@ async function loadUserVideos(pubkey) { } else if (cardEl.dataset.ownerPubkey) { delete cardEl.dataset.ownerPubkey; } + if (typeof video.id === "string" && video.id) { + cardEl.dataset.videoId = video.id; + } else if (cardEl.dataset.videoId) { + delete cardEl.dataset.videoId; + } const rawMagnet = typeof video.magnet === "string" ? video.magnet : ""; @@ -1933,6 +1938,14 @@ async function loadUserVideos(pubkey) { delete cardEl.dataset.magnet; } + if (trimmedUrl) { + cardEl.dataset.playUrl = encodeURIComponent(trimmedUrl); + } else if (cardEl.dataset.playUrl) { + delete cardEl.dataset.playUrl; + } + + cardEl.dataset.playMagnet = playbackMagnet || ""; + // Leave the data-play-* attributes empty in the template markup so the raw // URL/magnet strings can be assigned after parsing without HTML entity // escaping, keeping this renderer consistent with app.js. The stored URL is