mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-03 19:35:28 +00:00
Fix playback data encoding for cards
This commit is contained in:
1 parent
f61291f75b
commit
f482124411
3 files changed
+24
-19
No files matched your search
+4
-2
@@ -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 || "";
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user