feat: Add thumbnail management for albums and people, implement face embedding functionality

This commit is contained in:
2025-11-15 22:50:53 +01:00
parent 98f56e4f1e
commit 0f3e098d6d
28 changed files with 560 additions and 26 deletions

View File

@@ -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(())
}
}