fix warning while persisting tracks
All checks were successful
tests / fmt (push) Successful in 36s
tests / build (push) Successful in 2m3s
tests / test (push) Successful in 55s
tests / clippy (push) Successful in 41s
tests / pre-commit (push) Successful in 2m40s
deploy / release-image (push) Successful in 7m2s

This commit is contained in:
2024-08-09 11:18:38 +02:00
parent f7dca8ff65
commit 440201e153
2 changed files with 21 additions and 34 deletions

View File

@@ -103,14 +103,14 @@ async fn persistence(
db::track::insert_guild(&state.pool, db::track::Guild::new(guild_id.to_string()))
.await
.expect("failed to insert guild: {e}");
.context("failed to insert guild")?;
db::track::insert_user(
&state.pool,
db::track::User::new(user_id.to_string(), author_name, author_global_name),
)
.await
.expect("failed to insert user: {e}");
.context("failed to insert user")?;
let track_id = db::track::insert_track(
&state.pool,
@@ -123,13 +123,14 @@ async fn persistence(
),
)
.await
.context("failed to insert track: {e}")?;
.context("failed to insert track")?;
db::track::insert_query(
&state.pool,
db::track::Query::new(user_id.to_string(), guild_id.to_string(), track_id),
)
.await
.context("failed to insert track: {e}")?;
.context("failed to insert query")?;
Ok(())
}