Modify the `VideoSyncService` in `server/videoSync.ts` to insert new videos into the database with all required columns, including `content_type`, `genre`, and `upload_status`.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: d17a6e5e-0a8b-4a50-b346-88bffd02af01
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Implement robust error handling and directory creation for video uploads, enhance file validation with MIME type checking, and adjust database sync timeout for improved reliability.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 70557b10-8a46-4f62-9cec-2397b6c48e73
Replit-Commit-Checkpoint-Type: full_checkpoint
Refactor server-side video retrieval logic to first check local cache via `videoSyncService.getVideos` and `videoSyncService.getVideo`, falling back to `bunnyService.getVideo` only if cache misses. This change removes database merging logic from `videoSyncService` and integrates it into `BunnyStorage` when retrieving individual videos, optimizing data access.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 2cd2c0bc-434c-4bc9-ad3f-b99d3897a0d1
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/2cd2c0bc-434c-4bc9-ad3f-b99d3897a0d1/DVlzRoR
Adjust the video synchronization service to correctly determine if more pages of videos exist by checking the total fetched count against the total available videos and the number of videos returned per page. A small delay is introduced between paginated requests to prevent potential rate limiting issues from the video source.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 2eb1084e-b728-4449-9231-f1665924c8d5
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/2eb1084e-b728-4449-9231-f1665924c8d5/h92OTmA
Implement a paginated fetching mechanism for all videos from an external service and synchronize them to the PostgreSQL database, handling both new insertions and updates for existing video records.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 2eb1084e-b728-4449-9231-f1665924c8d5
Replit-Commit-Checkpoint-Type: full_checkpoint