Fix playback data encoding for cards

This commit is contained in:
thePR0M3TH3AN committed 2025-09-24 21:34:01 -04:00
1 parent f61291f75b
commit f482124411
3 files changed
+24 -19

No files matched your search

+4 -2
View File
@@ -408,11 +408,13 @@ class SubscriptionsManager {
if (cardEl) {
// Leave the data-play-* attributes empty in the literal markup so we can
// assign the raw URL/magnet strings post-parsing without HTML entity
// escaping, mirroring the approach in app.js.
// escaping, mirroring the approach in app.js. The URL is encoded so that
// special characters survive storage in data-* attributes; the click
// handler decodes it right before playback while keeping the magnet raw.
const interactiveEls = cardEl.querySelectorAll("[data-video-id]");
interactiveEls.forEach((el) => {
if (!el.dataset) return;
el.dataset.playUrl = playbackUrl || "";
el.dataset.playUrl = encodeURIComponent(playbackUrl || "");
el.dataset.playMagnet = playbackMagnet || "";
});
}