diff --git a/find_duplicate_files/find_duplicate_files.py b/find_duplicate_files/find_duplicate_files.py index 48a4c43..b40d9a4 100644 --- a/find_duplicate_files/find_duplicate_files.py +++ b/find_duplicate_files/find_duplicate_files.py @@ -65,6 +65,14 @@ class find_duplicate_files: self.cache_db.commit() return result + def _cache_size(self): + result = self.cur.execute('SELECT count(*) FROM files') + row = result.fetchone() + if row and len(row) > 0: + return row[0] + else: + return False + def recursive_scandir(self, path, ignore_hidden_files=True): ''' Recursively scan a directory for files''' files = dict() @@ -90,7 +98,7 @@ class find_duplicate_files: files = { **files, **more_files } except PermissionError as error: self._log.warning(f"Permission denied accessing folder '{path}'") - self._log.debug(f"Found {len(files)} files in '{path}'.") + self._log.debug(f"Found {len(files)} files in '{path}'. Cache contains {self._cache_size()} records.") return files def _init_log(self):