From b494e83efd647b035c6bee2fa09a33fa383ef4a3 Mon Sep 17 00:00:00 2001 From: Julien Valroff Date: Mon, 23 May 2011 21:05:06 +0200 Subject: Imported Upstream version 0.4.1 --- rapid/scan.py | 56 ++++++++++++++++++++++++++------------------------------ 1 file changed, 26 insertions(+), 30 deletions(-) (limited to 'rapid/scan.py') diff --git a/rapid/scan.py b/rapid/scan.py index e55f43d..5092f0a 100755 --- a/rapid/scan.py +++ b/rapid/scan.py @@ -114,40 +114,36 @@ class Scan(multiprocessing.Process): file_type = rpdfile.file_type(ext) if file_type is not None: - # count how many files of each type are included - # e.g. photo, video - self.file_type_counter.add(file_type) - self.counter += 1 - display_name = child.get_display_name() - size = child.get_size() - modification_time = child.get_modification_time() file_id = child.get_attribute_string( gio.FILE_ATTRIBUTE_ID_FILE) - scanned_file = rpdfile.get_rpdfile(ext, - name, - display_name, - path.get_path(), - size, - modification_time, - self.pid, - file_id) + if file_id is not None: + # count how many files of each type are included + # e.g. photo, video + self.file_type_counter.add(file_type) + self.counter += 1 + display_name = child.get_display_name() + size = child.get_size() + modification_time = child.get_modification_time() + + scanned_file = rpdfile.get_rpdfile(ext, + name, + display_name, + path.get_path(), + size, + modification_time, + self.pid, + file_id) - if self.generate_folder: - # this dramatically slows scanning speed, and it - # is unlikely this will be called this early in the - # workflow - scanned_file.read_metadata() + self.files.append(scanned_file) - self.files.append(scanned_file) - - if self.counter == self.batch_size: - # send batch of results - self.results_pipe.send((rpdmp.CONN_PARTIAL, - self.files)) - self.files = [] - self.counter = 0 - - file_size_sum += size + if self.counter == self.batch_size: + # send batch of results + self.results_pipe.send((rpdmp.CONN_PARTIAL, + self.files)) + self.files = [] + self.counter = 0 + + file_size_sum += size return file_size_sum -- cgit v1.2.3