fix(download dir): fix logic error in detecting dir

This commit is contained in:
DecDuck
2024-11-10 22:31:11 +11:00
parent 6a38ea306b
commit 04368ff549

View File

@ -103,7 +103,7 @@ pub fn add_new_download_dir(new_dir: String) -> Result<(), String> {
let metadata = new_dir_path let metadata = new_dir_path
.metadata() .metadata()
.map_err(|e| format!("Unable to access file or directory: {}", e.to_string()))?; .map_err(|e| format!("Unable to access file or directory: {}", e.to_string()))?;
if metadata.is_dir() { if !metadata.is_dir() {
return Err("Invalid path: not a directory".to_string()); return Err("Invalid path: not a directory".to_string());
} }
let dir_contents = new_dir_path let dir_contents = new_dir_path