diff --git a/.replit b/.replit index c806144..6ce283d 100644 --- a/.replit +++ b/.replit @@ -40,3 +40,4 @@ args = "npm run dev" waitForPort = 5000 [agent] +integrations = ["javascript_log_in_with_replit:1.0.0"] diff --git a/server/bunny.ts b/server/bunny.ts index 7161539..8e273fd 100644 --- a/server/bunny.ts +++ b/server/bunny.ts @@ -84,7 +84,10 @@ export class BunnyService { // Extract description from BunnyVideoDetails if available let description = 'description' in bunnyVideo ? bunnyVideo.description || "" : ""; - // Always check metaTags for description since Bunny.net stores it there + // Extract artist from metaTags if available + let artist = null; + + // Always check metaTags for description and artist since Bunny.net stores it there if (bunnyVideo.metaTags && bunnyVideo.metaTags.length > 0) { const descriptionTag = bunnyVideo.metaTags.find((tag: any) => tag.property?.toLowerCase() === 'description' @@ -92,6 +95,23 @@ export class BunnyService { if (descriptionTag && descriptionTag.value) { description = descriptionTag.value; } + + // Look for artist in metaTags + const artistTag = bunnyVideo.metaTags.find((tag: any) => + tag.property?.toLowerCase() === 'artist' || tag.property?.toLowerCase() === 'performer' + ); + if (artistTag && artistTag.value) { + artist = artistTag.value; + } + } + + // Clean title - remove .mpg4, .mp4, .MPG4, .MP4 extensions + let cleanTitle = bunnyVideo.title || 'Untitled Video'; + cleanTitle = cleanTitle.replace(/\.(mpg4|mp4|MPG4|MP4)$/i, ''); + + // Clean artist - remove .mpg4, .mp4, .MPG4, .MP4 extensions if artist exists + if (artist) { + artist = artist.replace(/\.(mpg4|mp4|MPG4|MP4)$/i, ''); } // No category from Bunny.net - keeping category empty @@ -102,16 +122,25 @@ export class BunnyService { return { id: bunnyVideo.guid, - title: bunnyVideo.title || 'Untitled Video', + title: cleanTitle, + artist: artist, description: description, + filename: null, + episodeNumber: null, + episodeTitle: null, thumbnailUrl, customThumbnailUrl: null, + faceCenterPosition: null, + facesDetected: null, + faceConfidence: null, videoUrl: hlsUrl, // Signed HLS URL videoUrlMp4: hlsUrl, // Use signed HLS URL for preview as well videoUrlIframe: iframeUrl, // iframe fallback duration: Math.floor(bunnyVideo.length || 0), views: bunnyVideo.views || 0, category: category, + contentType: 'video' as const, + genre: 'other' as const, tags: tags, isPublic: true, uploadStatus: "completed", @@ -121,9 +150,6 @@ export class BunnyService { resolution: null, format: null, encoding: null, - faceCenterPosition: null, - facesDetected: null, - faceConfidence: null, createdAt: new Date(bunnyVideo.dateUploaded), updatedAt: new Date(bunnyVideo.dateUploaded) };