Cargo fmt
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
use crate::cleanup::database_updater::DatabaseUpdater;
|
||||
use crate::cleanup::file_type_detector::{detect_file_type, should_rename};
|
||||
use crate::cleanup::types::{CleanupConfig, CleanupStats};
|
||||
use anyhow::{Context, Result};
|
||||
use dialoguer::Confirm;
|
||||
use log::{error, info, warn};
|
||||
use anyhow::Result;
|
||||
use log::{error, warn};
|
||||
use std::fs;
|
||||
use std::path::{Path, PathBuf};
|
||||
use walkdir::WalkDir;
|
||||
@@ -79,10 +78,7 @@ pub fn validate_file_types(
|
||||
|
||||
// Check if destination already exists
|
||||
if new_file_path.exists() {
|
||||
warn!(
|
||||
"✗ Destination already exists: {}",
|
||||
new_relative_path
|
||||
);
|
||||
warn!("✗ Destination already exists: {}", new_relative_path);
|
||||
stats.add_error(format!(
|
||||
"Destination exists for {}: {}",
|
||||
relative_path, new_relative_path
|
||||
@@ -127,8 +123,7 @@ pub fn validate_file_types(
|
||||
println!("✓ Renamed file");
|
||||
|
||||
// Update database
|
||||
match db_updater
|
||||
.update_file_path(relative_path, new_relative_path)
|
||||
match db_updater.update_file_path(relative_path, new_relative_path)
|
||||
{
|
||||
Ok(_) => {
|
||||
files_renamed += 1;
|
||||
@@ -148,7 +143,10 @@ pub fn validate_file_types(
|
||||
}
|
||||
Err(e) => {
|
||||
error!("✗ Failed to rename file: {:?}", e);
|
||||
stats.add_error(format!("Rename failed for {}: {}", relative_path, e));
|
||||
stats.add_error(format!(
|
||||
"Rename failed for {}: {}",
|
||||
relative_path, e
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -190,7 +188,8 @@ fn is_supported_media_file(path: &Path) -> bool {
|
||||
let ext_lower = ext_str.to_lowercase();
|
||||
return matches!(
|
||||
ext_lower.as_str(),
|
||||
"jpg" | "jpeg"
|
||||
"jpg"
|
||||
| "jpeg"
|
||||
| "png"
|
||||
| "webp"
|
||||
| "tiff"
|
||||
|
||||
Reference in New Issue
Block a user