diff --git a/server/index.ts b/server/index.ts index 61d48cb..c94281a 100644 --- a/server/index.ts +++ b/server/index.ts @@ -115,11 +115,40 @@ app.use((req, res, next) => { ` - `; + + + + + + + + + + + + `; template = template.replace('', `${additionalMeta}\n`); diff --git a/server/routes.ts b/server/routes.ts index 56d5e08..fa1acb5 100644 --- a/server/routes.ts +++ b/server/routes.ts @@ -767,7 +767,7 @@ export async function registerRoutes(app: Express): Promise { return res.status(404).send('Video not found'); } - // Najprej poskušamo uporabiti dejanski video thumbnail iz Bunny.net + // Uporabimo čisti thumbnail iz Bunny.net if (video.thumbnailUrl) { try { // Prenesemo dejanski thumbnail iz Bunny.net @@ -775,34 +775,15 @@ export async function registerRoutes(app: Express): Promise { if (response.ok) { const thumbnailBuffer = await response.arrayBuffer(); - // Povečamo thumbnail na social media velikost (1200x630) z dodano go4.video branding overlay - const overlayedBuffer = await sharp(Buffer.from(thumbnailBuffer)) + // Preprosto povečamo thumbnail na social media velikost (1200x630) brez overlay-a + const resizedBuffer = await sharp(Buffer.from(thumbnailBuffer)) .resize(1200, 630, { fit: 'cover', position: 'center' }) - .composite([ - // Dodamo temno overlay za boljši kontrast teksta - { - input: Buffer.from( - ` - - - - go4.video - Professional Video Platform - - - ${Math.floor(video.duration / 60)}:${(video.duration % 60).toString().padStart(2, '0')} - ` - ), - top: 0, - left: 0, - } - ]) .png({ quality: 90, compressionLevel: 6 }) .toBuffer(); res.setHeader('Content-Type', 'image/png'); res.setHeader('Cache-Control', 'public, max-age=3600'); // Cache za 1 uro - return res.send(overlayedBuffer); + return res.send(resizedBuffer); } } catch (fetchError) { console.log('Failed to fetch real thumbnail, falling back to generated:', fetchError);