diff --git a/client/src/pages/VideoPage.tsx b/client/src/pages/VideoPage.tsx index 1791674..98e3c4f 100644 --- a/client/src/pages/VideoPage.tsx +++ b/client/src/pages/VideoPage.tsx @@ -157,7 +157,7 @@ export default function VideoPage() { if (metaDescription) { const descriptionContent = currentVideo.description && currentVideo.description.trim() !== '' ? currentVideo.description - : `Schauen Sie sich "${currentVideo.title}" auf go4.video an. Professionelle Video-Streaming-Plattform mit exklusivem Content von FOLX STADL, Geschichte des Liedes und weiteren Premium-Inhalten.`; + : `${currentVideo.title} - Professionelle Video-Streaming-Plattform mit exklusivem Content von FOLX STADL, Geschichte des Liedes und weiteren Premium-Inhalten auf go4.video.`; metaDescription.setAttribute('content', descriptionContent); } @@ -177,7 +177,7 @@ export default function VideoPage() { // Use original description if available, otherwise create rich description const richDescription = currentVideo.description && currentVideo.description.trim() !== '' ? currentVideo.description - : `Schauen Sie sich "${currentVideo.title}" auf go4.video an. Professionelle Video-Streaming-Plattform mit exklusivem Content von FOLX STADL, Geschichte des Liedes und weiteren Premium-Inhalten.`; + : `${currentVideo.title} - Professionelle Video-Streaming-Plattform mit exklusivem Content von FOLX STADL, Geschichte des Liedes und weiteren Premium-Inhalten auf go4.video.`; updateMetaTag('og:description', richDescription); // Get the correct domain dynamically and add cache-busting diff --git a/server/routes.ts b/server/routes.ts index 8ae8bb9..3ffd89c 100644 --- a/server/routes.ts +++ b/server/routes.ts @@ -840,29 +840,35 @@ export async function registerRoutes(app: Express): Promise { const video = await storage.getVideo(videoId); if (!video) { + console.log(`❌ Video not found: ${videoId}`); return res.status(404).send('Video not found'); } - // Uporabimo čisti thumbnail iz Bunny.net + console.log(`🖼️ Generating thumbnail for: ${video.title}`); + + // Uporabimo čisti thumbnail iz Bunny.net - prioriteta if (video.thumbnailUrl) { try { - // Prenesemo dejanski thumbnail iz Bunny.net + console.log(`📥 Fetching thumbnail from Bunny.net: ${video.thumbnailUrl}`); const response = await fetch(video.thumbnailUrl); if (response.ok) { const thumbnailBuffer = await response.arrayBuffer(); - // Preprosto povečamo thumbnail na social media velikost (1200x630) brez overlay-a + // Optimiziramo thumbnail za social media brez overlay-a const resizedBuffer = await sharp(Buffer.from(thumbnailBuffer)) .resize(1200, 630, { fit: 'cover', position: 'center' }) - .png({ quality: 90, compressionLevel: 6 }) + .jpeg({ quality: 85, progressive: true }) // JPEG je bolje za photo thumbnails .toBuffer(); - res.setHeader('Content-Type', 'image/png'); - res.setHeader('Cache-Control', 'public, max-age=3600'); // Cache za 1 uro + console.log(`✅ Real thumbnail processed: ${resizedBuffer.length} bytes`); + + res.setHeader('Content-Type', 'image/jpeg'); + res.setHeader('Cache-Control', 'public, max-age=7200'); // Cache za 2 uri + res.setHeader('Access-Control-Allow-Origin', '*'); return res.send(resizedBuffer); } } catch (fetchError) { - console.log('Failed to fetch real thumbnail, falling back to generated:', fetchError); + console.log('⚠️ Failed to fetch real thumbnail, falling back to generated:', fetchError); } }