Fix: Use maxresdefault thumbnails for consistent 16:9 sizing
This commit is contained in:
parent
b079c426d7
commit
16e146ce11
6 changed files with 9 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
module kvtube-go
|
||||
|
||||
go 1.24.0
|
||||
go 1.25.0
|
||||
|
||||
require (
|
||||
github.com/gin-gonic/gin v1.11.0
|
||||
|
|
|
|||
|
|
@ -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{
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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', () => {
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ async function getVideoInfo(id: string): Promise<VideoInfo | null> {
|
|||
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: ''
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue