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 ----
|
# ---- Backend Builder ----
|
||||||
FROM golang:1.24-alpine AS backend-builder
|
FROM golang:1.25-alpine AS backend-builder
|
||||||
ENV GOTOOLCHAIN=local
|
ENV GOTOOLCHAIN=local
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN apk add --no-cache git gcc musl-dev
|
RUN apk add --no-cache git gcc musl-dev
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
module kvtube-go
|
module kvtube-go
|
||||||
|
|
||||||
go 1.24.0
|
go 1.25.0
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/gin-gonic/gin v1.11.0
|
github.com/gin-gonic/gin v1.11.0
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ func sanitizeVideoData(entry YtDlpEntry) VideoData {
|
||||||
|
|
||||||
thumbnail := ""
|
thumbnail := ""
|
||||||
if entry.ID != "" {
|
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{
|
return VideoData{
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ export async function POST(request: NextRequest) {
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
video_id,
|
video_id,
|
||||||
title: title || `Video ${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',
|
cache: 'no-store',
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -295,7 +295,7 @@ export default function VideoPlayer({ videoId, title }: VideoPlayerProps) {
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
video_id: videoId,
|
video_id: videoId,
|
||||||
title: title,
|
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));
|
}).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',
|
title: title || 'KV-Tube Video',
|
||||||
artist: 'KV-Tube',
|
artist: 'KV-Tube',
|
||||||
artwork: [
|
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', () => {
|
navigator.mediaSession.setActionHandler('play', () => {
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ async function getVideoInfo(id: string): Promise<VideoInfo | null> {
|
||||||
uploader: data.uploader || 'Unknown',
|
uploader: data.uploader || 'Unknown',
|
||||||
channel_id: data.channel_id || '',
|
channel_id: data.channel_id || '',
|
||||||
view_count: data.view_count || 0,
|
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) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
|
@ -115,7 +115,7 @@ export default async function WatchPage({
|
||||||
id: v,
|
id: v,
|
||||||
title: `Mix - ${info.uploader || 'Auto-generated'}`,
|
title: `Mix - ${info.uploader || 'Auto-generated'}`,
|
||||||
uploader: info.uploader || 'KV-Tube',
|
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,
|
view_count: 0,
|
||||||
duration: '50+',
|
duration: '50+',
|
||||||
list_id: `RD${v}`,
|
list_id: `RD${v}`,
|
||||||
|
|
@ -137,7 +137,7 @@ export default async function WatchPage({
|
||||||
id: mixBaseId,
|
id: mixBaseId,
|
||||||
title: baseInfo.title,
|
title: baseInfo.title,
|
||||||
uploader: baseInfo.uploader,
|
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,
|
view_count: baseInfo.view_count,
|
||||||
duration: ''
|
duration: ''
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue