From 6bed226057d56f56a992f6ea630bc32cc5e7ed13 Mon Sep 17 00:00:00 2001 From: Craig Drummond Date: Tue, 15 Feb 2022 21:31:01 +0000 Subject: [PATCH] Check if there are files to scan --- src/analyse.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/analyse.rs b/src/analyse.rs index f9892d4..880fc69 100644 --- a/src/analyse.rs +++ b/src/analyse.rs @@ -157,9 +157,11 @@ pub fn analyse_files(db_path: &str, mpath: &Path, path: &Path, dry_run:bool, kee } if !dry_run { to_add.sort(); - match analyse_new_files(&db, mpath, to_add) { - Ok(_) => { }, - Err(_) => { } + if to_add.len()>0 { + match analyse_new_files(&db, mpath, to_add) { + Ok(_) => { }, + Err(_) => { } + } } }