diff --git a/src/library/video.rs b/src/library/video.rs index e18afc9..31e1dad 100644 --- a/src/library/video.rs +++ b/src/library/video.rs @@ -146,7 +146,7 @@ impl Video { for cat in meta.categories().unwrap() { sqlx::query( - "INSERT INTO youtube_meta_categories (youtube_id, category) VALUES ($1, $2)", + "INSERT INTO youtube_meta_categories (youtube_id, category) VALUES ($1, $2) ON CONFLICT DO NOTHING", ) .bind(meta.youtube_id().unwrap()) .bind(cat) @@ -157,7 +157,7 @@ impl Video { if let Some(tags) = meta.tags() { for tag in tags { - sqlx::query("INSERT INTO youtube_meta_tags (youtube_id, tag) VALUES ($1, $2)") + sqlx::query("INSERT INTO youtube_meta_tags (youtube_id, tag) VALUES ($1, $2) ON CONFLICT DO NOTHING") .bind(&meta.youtube_id().unwrap()) .bind(&tag) .execute(&mut *tx)