fix
All checks were successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
JMARyA 2024-12-14 22:11:17 +01:00
parent 4ede8e16e8
commit 954e660343
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263

View file

@ -146,7 +146,7 @@ impl Video {
for cat in meta.categories().unwrap() { for cat in meta.categories().unwrap() {
sqlx::query( 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(meta.youtube_id().unwrap())
.bind(cat) .bind(cat)
@ -157,7 +157,7 @@ impl Video {
if let Some(tags) = meta.tags() { if let Some(tags) = meta.tags() {
for tag in 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(&meta.youtube_id().unwrap())
.bind(&tag) .bind(&tag)
.execute(&mut *tx) .execute(&mut *tx)