Add URL-aware playback delegation with fallback handling

This commit is contained in:
thePR0M3TH3AN committed 2025-09-22 12:58:51 -04:00
1 parent ad5f8958c5
commit 2ed1cc50db
3 files changed
+244 -147

No files matched your search

+7 -2
View File
@@ -250,6 +250,11 @@ class SubscriptionsManager {
// Only declare localAuthorSet once
const localAuthorSet = new Set();
const encodeDataValue = (value) =>
typeof value === "string" && value.length > 0
? encodeURIComponent(value)
: "";
videos.forEach((video, index) => {
if (!video.id || !video.title) {
console.error("Missing ID or title:", video);
@@ -329,8 +334,8 @@ class SubscriptionsManager {
const safeTitle = window.app?.escapeHTML(video.title) || "Untitled";
const safeThumb = window.app?.escapeHTML(video.thumbnail) || "";
const encodedMagnet = encodeURIComponent(video.magnet || "");
const encodedUrl = encodeURIComponent(video.url || "");
const encodedMagnet = encodeDataValue(video.magnet);
const encodedUrl = encodeDataValue(video.url);
const cardHtml = `
<div class="video-card bg-gray-900 rounded-lg overflow-hidden shadow-lg hover:shadow-2xl transition-all duration-300 ${highlightClass}">
<a