diff --git a/server/routes.ts b/server/routes.ts index ee873cf..2222f6d 100644 --- a/server/routes.ts +++ b/server/routes.ts @@ -176,6 +176,26 @@ export async function registerRoutes(app: Express): Promise { } }); + // Manual sync endpoint to force refresh from Bunny.net + app.post("/api/bunny/sync", async (req, res) => { + try { + console.log('🔄 Manual video sync requested...'); + // Import videoSyncService to trigger manual sync + const { videoSyncService } = await import('./videoSync'); + await videoSyncService.initialize(); + + const videos = await storage.getVideos(1, 1000); + res.json({ + message: "Video sync completed successfully", + totalVideos: videos.length, + timestamp: new Date().toISOString() + }); + } catch (error) { + console.error("Error during manual sync:", error); + res.status(500).json({ message: "Failed to sync videos from Bunny.net" }); + } + }); + app.get("/api/videos", async (req, res) => {