delete multiple files with selection
This commit is contained in:
@@ -87,11 +87,26 @@ impl WarrenNotifier for NotifierDebugLogger {
|
||||
}
|
||||
|
||||
async fn warren_rm(&self, response: &WarrenRmResponse) {
|
||||
tracing::debug!(
|
||||
"[Notifier] Deleted file {} from warren {}",
|
||||
response.path(),
|
||||
response.warren().name(),
|
||||
);
|
||||
let span = tracing::debug_span!("warren_rm", "{}", response.warren().name()).entered();
|
||||
|
||||
let results = response.results();
|
||||
|
||||
for result in results {
|
||||
match result.as_ref() {
|
||||
Ok(path) => tracing::debug!("Deleted file: {path}"),
|
||||
Err(e) => match e {
|
||||
crate::domain::warren::models::file::RmError::NotFound(path) => {
|
||||
tracing::debug!("File not found: {path}")
|
||||
}
|
||||
crate::domain::warren::models::file::RmError::NotEmpty(path) => {
|
||||
tracing::debug!("Directory not empty: {path}")
|
||||
}
|
||||
crate::domain::warren::models::file::RmError::Unknown(_) => (),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
span.exit();
|
||||
}
|
||||
|
||||
async fn warren_mv(&self, response: &WarrenMvResponse) {
|
||||
@@ -392,9 +407,11 @@ impl AuthNotifier for NotifierDebugLogger {
|
||||
}
|
||||
|
||||
async fn auth_warren_rm(&self, user: &User, response: &WarrenRmResponse) {
|
||||
let results = response.results();
|
||||
let successes = results.iter().filter(|r| r.is_ok()).count();
|
||||
|
||||
tracing::debug!(
|
||||
"[Notifier] Deleted file {} from warren {} for authenticated user {}",
|
||||
response.path(),
|
||||
"[Notifier] Deleted {successes} file(s) from warren {} for authenticated user {}",
|
||||
response.warren().name(),
|
||||
user.id(),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user