diff --git a/src/library/video.rs b/src/library/video.rs index b9dfa7a..8fe9d4b 100644 --- a/src/library/video.rs +++ b/src/library/video.rs @@ -106,7 +106,7 @@ impl Video { let vid_duration = get_vid_duration(v).unwrap(); if let Some(meta) = yt_meta::get_youtube_metadata(v) { - sqlx::query("INSERT INTO youtube_meta (id, title, description, uploader_name, uploader_id, views, upload_date) VALUES ($1, $2, $3, $4, $5, $6, $7)") + sqlx::query("INSERT INTO youtube_meta (id, title, description, uploader_name, uploader_id, views, upload_date) VALUES ($1, $2, $3, $4, $5, $6, $7) ON CONFLICT (id) DO UPDATE SET title = EXCLUDED.title, description = EXCLUDED.description, uploader_name = EXCLUDED.uploader_name, uploader_id = EXCLUDED.uploader_id, views = EXCLUDED.views, upload_date = EXCLUDED.upload_date;") .bind(&meta.youtube_id().unwrap()) .bind(&meta.title()) .bind(&meta.description().unwrap())