move multiple files at once

This commit is contained in:
2025-09-05 01:22:40 +02:00
parent 13e91fdfbf
commit 49c59cbaea
14 changed files with 224 additions and 112 deletions

View File

@@ -110,12 +110,28 @@ impl WarrenNotifier for NotifierDebugLogger {
}
async fn warren_mv(&self, response: &WarrenMvResponse) {
tracing::debug!(
"[Notifier] Renamed file {} to {} in warren {}",
response.old_path(),
response.path(),
response.warren().name(),
);
let span = tracing::debug_span!("warren_mv", "{}", response.warren().name()).entered();
let results = response.results();
for result in results {
match result.as_ref() {
Ok((old_path, new_path)) => {
tracing::debug!("Moved file {old_path} to {new_path}")
}
Err(e) => match e {
crate::domain::warren::models::file::MvError::NotFound(path) => {
tracing::debug!("File not found: {path}")
}
crate::domain::warren::models::file::MvError::AlreadyExists(path) => {
tracing::debug!("File already exists: {path}")
}
crate::domain::warren::models::file::MvError::Unknown(_) => (),
},
}
}
span.exit();
}
async fn warren_touch(&self, warren: &Warren, path: &AbsoluteFilePath) {
@@ -418,10 +434,11 @@ impl AuthNotifier for NotifierDebugLogger {
}
async fn auth_warren_mv(&self, user: &User, response: &WarrenMvResponse) {
let results = response.results();
let successes = results.iter().filter(|r| r.is_ok()).count();
tracing::debug!(
"[Notifier] Renamed file {} to {} in warren {} for authenticated user {}",
response.old_path(),
response.path(),
"[Notifier] Moved {successes} file(s) in warren {} for authenticated user {}",
response.warren().name(),
user.id(),
);