feat: implement media metadata management with EXIF and TrackInfo support
This commit is contained in:
@@ -3,7 +3,7 @@ use uuid::Uuid;
|
||||
|
||||
use crate::{
|
||||
error::CoreResult,
|
||||
models::{Album, AlbumPermission, Media, User}, schema::ListMediaOptions,
|
||||
models::{Album, AlbumPermission, Media, MediaMetadata, User}, schema::ListMediaOptions,
|
||||
};
|
||||
|
||||
#[async_trait]
|
||||
@@ -12,14 +12,6 @@ pub trait MediaRepository: Send + Sync {
|
||||
async fn create(&self, media: &Media) -> CoreResult<()>;
|
||||
async fn find_by_id(&self, id: Uuid) -> CoreResult<Option<Media>>;
|
||||
async fn list_by_user(&self, user_id: Uuid, options: &ListMediaOptions) -> CoreResult<Vec<Media>>;
|
||||
async fn update_exif_data(
|
||||
&self,
|
||||
id: Uuid,
|
||||
width: Option<i32>,
|
||||
height: Option<i32>,
|
||||
location: Option<String>,
|
||||
date_taken: Option<chrono::DateTime<chrono::Utc>>,
|
||||
) -> CoreResult<()>;
|
||||
async fn update_thumbnail_path(&self, id: Uuid, thumbnail_path: String) -> CoreResult<()>;
|
||||
async fn delete(&self, id: Uuid) -> CoreResult<()>;
|
||||
}
|
||||
@@ -60,3 +52,9 @@ pub trait AlbumShareRepository: Send + Sync {
|
||||
|
||||
async fn is_media_in_shared_album(&self, media_id: Uuid, user_id: Uuid) -> CoreResult<bool>;
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
pub trait MediaMetadataRepository: Send + Sync {
|
||||
async fn create_batch(&self, metadata: &[MediaMetadata]) -> CoreResult<()>;
|
||||
async fn find_by_media_id(&self, media_id: Uuid) -> CoreResult<Vec<MediaMetadata>>;
|
||||
}
|
||||
Reference in New Issue
Block a user