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,6 +1,14 @@
use libertas_core::models::{Album, AlbumPermission, AlbumShare, FaceRegion, Media, MediaMetadata, MediaMetadataSource, Person, PersonPermission, Role, Tag, User};
use libertas_core::models::{
Album, AlbumPermission, AlbumShare, FaceEmbedding, FaceRegion, Media, MediaMetadata,
MediaMetadataSource, Person, PersonPermission, Role, Tag, User,
};
use crate::db_models::{PostgresAlbum, PostgresAlbumPermission, PostgresAlbumShare, PostgresFaceRegion, PostgresMedia, PostgresMediaMetadata, PostgresMediaMetadataSource, PostgresPerson, PostgresPersonPermission, PostgresPersonShared, PostgresRole, PostgresTag, PostgresUser};
use crate::db_models::{
PostgresAlbum, PostgresAlbumPermission, PostgresAlbumShare, PostgresFaceEmbedding,
PostgresFaceRegion, PostgresMedia, PostgresMediaMetadata, PostgresMediaMetadataSource,
PostgresPerson, PostgresPersonPermission, PostgresPersonShared, PostgresRole, PostgresTag,
PostgresUser,
};
impl From<PostgresRole> for Role {
fn from(pg_role: PostgresRole) -> Self {
@@ -186,4 +194,15 @@ impl From<PostgresPersonShared> for (Person, PersonPermission) {
let permission = PersonPermission::from(pg_shared.permission);
(person, permission)
}
}
}
impl From<PostgresFaceEmbedding> for FaceEmbedding {
fn from(pg_embedding: PostgresFaceEmbedding) -> Self {
Self {
id: pg_embedding.id,
face_region_id: pg_embedding.face_region_id,
model_id: pg_embedding.model_id,
embedding: pg_embedding.embedding,
}
}
}