update
This commit is contained in:
@@ -203,8 +203,12 @@ impl Database {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn get_person_by_id(&self, id: i64) -> Option<Person> {
|
pub async fn get_person_by_id(&self, id: i64) -> Option<Person> {
|
||||||
sqlx::query_as::<_, Person>("SELECT * FROM persons WHERE id = ?")
|
let r = sqlx::query("SELECT * FROM persons WHERE id = ?").bind(id).fetch_optional(&self.pool).await.ok()??;
|
||||||
.bind(id).fetch_optional(&self.pool).await.ok().flatten()
|
Some(Person {
|
||||||
|
id: r.get("id"), name: r.get("name"), display_name: r.get("display_name"),
|
||||||
|
total_albums: r.get("total_albums"), total_images: r.get("total_images"),
|
||||||
|
original_names: r.get("original_names"), created_at: r.get("created_at"), updated_at: r.get("updated_at"),
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn update_album_person(&self, album_id: &str, person_name_original: &str, person_name_cleaned: &str) {
|
pub async fn update_album_person(&self, album_id: &str, person_name_original: &str, person_name_cleaned: &str) {
|
||||||
|
|||||||
Reference in New Issue
Block a user