From 257e19e9db0908e1638603c22639fa2c301e04ca Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 9 Feb 2026 13:32:47 +0000 Subject: [PATCH] display uploader --- frontend/css/style.css | 17 ++++++++++++++++- frontend/js/favorites.js | 12 +++++++++++- frontend/js/videos.js | 17 ++++++++++++++++- 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/frontend/css/style.css b/frontend/css/style.css index ee5626e..0e14907 100644 --- a/frontend/css/style.css +++ b/frontend/css/style.css @@ -737,7 +737,7 @@ body.theme-light .setting-item select option { /* Grid Container */ .grid-container { display: grid; - grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); + grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; padding: 24px; max-width: var(--grid-max); @@ -894,6 +894,21 @@ body.theme-light .setting-item select option { padding-bottom: 4px; } +.uploader-link { + background: transparent; + border: none; + color: inherit; + font: inherit; + cursor: pointer; + padding: 0; + text-align: left; +} + +.uploader-link:hover { + color: var(--text-primary); + text-decoration: underline; +} + .video-duration { color: var(--text-primary); opacity: 0.8; diff --git a/frontend/js/favorites.js b/frontend/js/favorites.js index ce2d426..e0f3d89 100644 --- a/frontend/js/favorites.js +++ b/frontend/js/favorites.js @@ -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 = ` ${item.title}

${item.title}

-

${item.channel}

+ ${uploaderText ? `

` : ''}
`; 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); }); diff --git a/frontend/js/videos.js b/frontend/js/videos.js index cc416b3..1205f8c 100644 --- a/frontend/js/videos.js +++ b/frontend/js/videos.js @@ -95,11 +95,12 @@ App.videos = App.videos || {}; card.className = 'video-card'; const durationText = App.videos.formatDuration(v.duration); const favoriteKey = App.favorites.getKey(v); + const uploaderText = v.uploader || v.channel || ''; card.innerHTML = ` ${v.title}

${v.title}

-

${v.channel}

+ ${uploaderText ? `

` : ''} ${durationText ? `

${durationText}

` : ''} `; const favoriteBtn = card.querySelector('.favorite-btn'); @@ -110,6 +111,14 @@ App.videos = App.videos || {}; App.favorites.toggle(v); }; } + const uploaderBtn = card.querySelector('.uploader-link'); + if (uploaderBtn) { + uploaderBtn.onclick = (event) => { + event.stopPropagation(); + const uploader = uploaderBtn.dataset.uploader || uploaderBtn.textContent || ''; + App.videos.handleSearch(uploader); + }; + } card.onclick = () => App.player.open(v.url); grid.appendChild(card); state.renderedVideoIds.add(v.id); @@ -119,6 +128,12 @@ App.videos = App.videos || {}; }; App.videos.handleSearch = function(value) { + if (typeof value === 'string') { + const searchInput = document.getElementById('search-input'); + if (searchInput && searchInput.value !== value) { + searchInput.value = value; + } + } state.currentPage = 1; state.hasNextPage = true; state.renderedVideoIds.clear();