Update video data insertion with all necessary fields

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
This commit is contained in:
sebastjanartic 2025-09-06 19:41:14 +00:00
parent 72295f7fe8
commit 3ecff16f75

View File

@ -116,10 +116,10 @@ class VideoSyncService {
};
if (existingVideo.rows.length === 0) {
// Insert new video using raw SQL to avoid schema issues
// Insert new video using raw SQL with all required columns
await db.execute(sql`
INSERT INTO videos (id, title, description, thumbnail_url, video_url, duration, views, category, custom_thumbnail_url, tags, is_public, created_at, updated_at)
VALUES (${videoData.id}, ${videoData.title}, ${videoData.description}, ${videoData.thumbnailUrl}, ${videoData.videoUrl}, ${videoData.duration}, ${videoData.views}, ${videoData.category}, ${videoData.customThumbnailUrl}, ${'{' + videoData.tags.join(',') + '}'}, ${videoData.isPublic}, ${videoData.createdAt.toISOString()}, ${videoData.updatedAt.toISOString()})
INSERT INTO videos (id, title, description, thumbnail_url, video_url, duration, views, category, custom_thumbnail_url, tags, is_public, content_type, genre, upload_status, created_at, updated_at)
VALUES (${videoData.id}, ${videoData.title}, ${videoData.description}, ${videoData.thumbnailUrl}, ${videoData.videoUrl}, ${videoData.duration}, ${videoData.views}, ${videoData.category}, ${videoData.customThumbnailUrl}, ${'{' + videoData.tags.join(',') + '}'}, ${videoData.isPublic}, 'video', 'other', 'completed', ${videoData.createdAt.toISOString()}, ${videoData.updatedAt.toISOString()})
`);
insertedCount++;
} else {