feat: Add thumbnail management for albums and people, implement face embedding functionality
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
use async_trait::async_trait;
|
||||
use libertas_core::{error::{CoreError, CoreResult}, models::Person, repositories::PersonRepository};
|
||||
use libertas_core::{
|
||||
error::{CoreError, CoreResult},
|
||||
models::Person,
|
||||
repositories::PersonRepository,
|
||||
};
|
||||
use sqlx::PgPool;
|
||||
use uuid::Uuid;
|
||||
|
||||
@@ -95,4 +99,20 @@ impl PersonRepository for PostgresPersonRepository {
|
||||
.map_err(|e| CoreError::Database(e.to_string()))?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
async fn set_thumbnail_media_id(&self, person_id: Uuid, media_id: Uuid) -> CoreResult<()> {
|
||||
sqlx::query!(
|
||||
r#"
|
||||
UPDATE people
|
||||
SET thumbnail_media_id = $1
|
||||
WHERE id = $2
|
||||
"#,
|
||||
media_id,
|
||||
person_id
|
||||
)
|
||||
.execute(&self.pool)
|
||||
.await
|
||||
.map_err(|e| CoreError::Database(e.to_string()))?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user