fix(trash)+refactor(file life cycle)
* fix issue with the empty trash (wasn't calling thumbnail clean up) * refactor file service life cycle (TrashService don't call directly ThumbnailService, but call the on_file_deleted() hook * remove unused mehod: _validate_user_ownership()
This commit is contained in:
@@ -11,6 +11,11 @@ pub trait TrashRepository: Send + Sync {
|
||||
async fn delete_permanently(&self, id: &Uuid, user_id: &Uuid) -> Result<()>;
|
||||
async fn clear_trash(&self, user_id: &Uuid) -> Result<()>;
|
||||
|
||||
/// All trashed file IDs for this user, regardless of parent folder trash status.
|
||||
/// Used by empty_trash for thumbnail cleanup — the view used by get_trash_items
|
||||
/// excludes files inside trashed folders, which would miss their ext thumbnails.
|
||||
async fn get_all_trashed_file_ids(&self, user_id: &Uuid) -> Result<Vec<String>>;
|
||||
|
||||
/// Bulk-delete all expired trash items (files + folders) in a single
|
||||
/// transaction. Returns `(files_deleted, folders_deleted)`.
|
||||
async fn delete_expired_bulk(&self) -> Result<(u64, u64)>;
|
||||
|
||||
Reference in New Issue
Block a user