From 04368ff5496c06bbda0f763ee2949c4d14f2f499 Mon Sep 17 00:00:00 2001 From: DecDuck Date: Sun, 10 Nov 2024 22:31:11 +1100 Subject: [PATCH] fix(download dir): fix logic error in detecting dir --- src-tauri/src/db.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-tauri/src/db.rs b/src-tauri/src/db.rs index 0858e1b..75657e2 100644 --- a/src-tauri/src/db.rs +++ b/src-tauri/src/db.rs @@ -103,7 +103,7 @@ pub fn add_new_download_dir(new_dir: String) -> Result<(), String> { let metadata = new_dir_path .metadata() .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()); } let dir_contents = new_dir_path