From 1ff385c826d8734702278849784ac332e714c06f Mon Sep 17 00:00:00 2001 From: Connor Johnstone Date: Tue, 24 Mar 2026 12:51:42 -0400 Subject: [PATCH] fixed deduplication once again. for real this time I think --- src/queries/wanted.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/queries/wanted.rs b/src/queries/wanted.rs index 55db4c9..96199ac 100644 --- a/src/queries/wanted.rs +++ b/src/queries/wanted.rs @@ -69,6 +69,16 @@ pub async fn update_status( Ok(active.update(db).await?) } +pub async fn find_by_mbid( + db: &DatabaseConnection, + musicbrainz_id: &str, +) -> DbResult> { + Ok(WantedItems::find() + .filter(wanted_item::Column::MusicbrainzId.eq(musicbrainz_id)) + .one(db) + .await?) +} + pub async fn remove(db: &DatabaseConnection, id: i32) -> DbResult<()> { WantedItems::delete_by_id(id).exec(db).await?; Ok(())