feat: Add thumbnail generation feature and update media model
- Updated workspace members to include `libertas_importer`. - Added a new migration to add `thumbnail_path` column to `media` table. - Enhanced configuration structures to include `thumbnail_config`. - Modified `Media` model to include `thumbnail_path`. - Updated `MediaRepository` trait and its implementation to handle thumbnail path updates. - Created `ThumbnailPlugin` for generating thumbnails based on media configurations. - Integrated thumbnail generation into the media processing workflow. - Updated dependencies in `libertas_worker` and `libertas_importer` for image processing.
This commit is contained in:
@@ -12,6 +12,22 @@ pub struct DatabaseConfig {
|
||||
pub url: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Clone)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum ThumbnailFormat {
|
||||
Jpeg,
|
||||
Webp,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Clone)]
|
||||
pub struct ThumbnailConfig {
|
||||
pub format: ThumbnailFormat,
|
||||
pub quality: u8,
|
||||
pub width: u32,
|
||||
pub height: u32,
|
||||
pub library_path: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Clone)]
|
||||
pub struct Config {
|
||||
pub database: DatabaseConfig,
|
||||
@@ -22,4 +38,5 @@ pub struct Config {
|
||||
pub max_upload_size_mb: Option<u32>,
|
||||
pub default_storage_quota_gb: Option<u64>,
|
||||
pub allowed_sort_columns: Option<Vec<String>>,
|
||||
pub thumbnail_config: Option<ThumbnailConfig>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user