From 16e146ce11611ca5d4a3bfcc6af09a9da114cc00 Mon Sep 17 00:00:00 2001 From: KV-Tube Deployer Date: Tue, 24 Mar 2026 23:03:51 +0700 Subject: [PATCH] Fix: Use maxresdefault thumbnails for consistent 16:9 sizing --- Dockerfile | 2 +- backend/go.mod | 2 +- backend/services/ytdlp.go | 2 +- frontend/app/api/history/route.ts | 2 +- frontend/app/watch/VideoPlayer.tsx | 4 ++-- frontend/app/watch/page.tsx | 6 +++--- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 81ceff0..42170e7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # ---- Backend Builder ---- -FROM golang:1.24-alpine AS backend-builder +FROM golang:1.25-alpine AS backend-builder ENV GOTOOLCHAIN=local WORKDIR /app RUN apk add --no-cache git gcc musl-dev diff --git a/backend/go.mod b/backend/go.mod index 6ed6c45..be11f68 100644 --- a/backend/go.mod +++ b/backend/go.mod @@ -1,6 +1,6 @@ module kvtube-go -go 1.24.0 +go 1.25.0 require ( github.com/gin-gonic/gin v1.11.0 diff --git a/backend/services/ytdlp.go b/backend/services/ytdlp.go index 9ac373d..14c6ef1 100644 --- a/backend/services/ytdlp.go +++ b/backend/services/ytdlp.go @@ -107,7 +107,7 @@ func sanitizeVideoData(entry YtDlpEntry) VideoData { thumbnail := "" if entry.ID != "" { - thumbnail = fmt.Sprintf("https://i.ytimg.com/vi/%s/hqdefault.jpg", entry.ID) + thumbnail = fmt.Sprintf("https://i.ytimg.com/vi/%s/maxresdefault.jpg", entry.ID) } return VideoData{ diff --git a/frontend/app/api/history/route.ts b/frontend/app/api/history/route.ts index 4859674..6e5dfd5 100644 --- a/frontend/app/api/history/route.ts +++ b/frontend/app/api/history/route.ts @@ -17,7 +17,7 @@ export async function POST(request: NextRequest) { body: JSON.stringify({ video_id, title: title || `Video ${video_id}`, - thumbnail: thumbnail || `https://i.ytimg.com/vi/${video_id}/hqdefault.jpg`, + thumbnail: thumbnail || `https://i.ytimg.com/vi/${video_id}/maxresdefault.jpg`, }), cache: 'no-store', }); diff --git a/frontend/app/watch/VideoPlayer.tsx b/frontend/app/watch/VideoPlayer.tsx index e175e37..bd4f389 100644 --- a/frontend/app/watch/VideoPlayer.tsx +++ b/frontend/app/watch/VideoPlayer.tsx @@ -295,7 +295,7 @@ export default function VideoPlayer({ videoId, title }: VideoPlayerProps) { body: JSON.stringify({ video_id: videoId, title: title, - thumbnail: `https://i.ytimg.com/vi/${videoId}/hqdefault.jpg`, + thumbnail: `https://i.ytimg.com/vi/${videoId}/maxresdefault.jpg`, }), }).catch(err => console.error('Failed to record history', err)); @@ -355,7 +355,7 @@ export default function VideoPlayer({ videoId, title }: VideoPlayerProps) { title: title || 'KV-Tube Video', artist: 'KV-Tube', artwork: [ - { src: `https://i.ytimg.com/vi/${videoId}/hqdefault.jpg`, sizes: '480x360', type: 'image/jpeg' } + { src: `https://i.ytimg.com/vi/${videoId}/maxresdefault.jpg`, sizes: '480x360', type: 'image/jpeg' } ] }); navigator.mediaSession.setActionHandler('play', () => { diff --git a/frontend/app/watch/page.tsx b/frontend/app/watch/page.tsx index 2027df3..e6803d5 100644 --- a/frontend/app/watch/page.tsx +++ b/frontend/app/watch/page.tsx @@ -42,7 +42,7 @@ async function getVideoInfo(id: string): Promise { uploader: data.uploader || 'Unknown', channel_id: data.channel_id || '', view_count: data.view_count || 0, - thumbnail: data.thumbnail || `https://i.ytimg.com/vi/${id}/hqdefault.jpg`, + thumbnail: data.thumbnail || `https://i.ytimg.com/vi/${id}/maxresdefault.jpg`, }; } catch (e) { console.error(e); @@ -115,7 +115,7 @@ export default async function WatchPage({ id: v, title: `Mix - ${info.uploader || 'Auto-generated'}`, uploader: info.uploader || 'KV-Tube', - thumbnail: info.thumbnail || `https://i.ytimg.com/vi/${v}/hqdefault.jpg`, + thumbnail: info.thumbnail || `https://i.ytimg.com/vi/${v}/maxresdefault.jpg`, view_count: 0, duration: '50+', list_id: `RD${v}`, @@ -137,7 +137,7 @@ export default async function WatchPage({ id: mixBaseId, title: baseInfo.title, uploader: baseInfo.uploader, - thumbnail: baseInfo.thumbnail || `https://i.ytimg.com/vi/${mixBaseId}/hqdefault.jpg`, + thumbnail: baseInfo.thumbnail || `https://i.ytimg.com/vi/${mixBaseId}/maxresdefault.jpg`, view_count: baseInfo.view_count, duration: '' });