display uploader

This commit is contained in:
Simon
2026-02-09 13:32:47 +00:00
parent ee1cb511df
commit 257e19e9db
3 changed files with 43 additions and 3 deletions

View File

@@ -34,6 +34,7 @@ App.favorites = App.favorites || {};
title: video.title || '',
thumb: video.thumb || '',
channel: video.channel || '',
uploader: video.uploader || video.channel || '',
duration: video.duration || 0
};
};
@@ -98,12 +99,13 @@ App.favorites = App.favorites || {};
const card = document.createElement('div');
card.className = 'favorite-card';
card.dataset.favKey = item.key;
const uploaderText = item.uploader || item.channel || '';
card.innerHTML = `
<button class="favorite-btn is-favorite" type="button" aria-pressed="true" aria-label="Remove from favorites" data-fav-key="${item.key}">♥</button>
<img src="${item.thumb}" alt="${item.title}">
<div class="favorite-info">
<h4>${item.title}</h4>
<p>${item.channel}</p>
${uploaderText ? `<p><button class="uploader-link" type="button" data-uploader="${uploaderText}">${uploaderText}</button></p>` : ''}
</div>
`;
card.onclick = () => App.player.open(item.url);
@@ -114,6 +116,14 @@ App.favorites = App.favorites || {};
App.favorites.toggle(item);
};
}
const uploaderBtn = card.querySelector('.uploader-link');
if (uploaderBtn) {
uploaderBtn.onclick = (event) => {
event.stopPropagation();
const uploader = uploaderBtn.dataset.uploader || uploaderBtn.textContent || '';
App.videos.handleSearch(uploader);
};
}
list.appendChild(card);
});