diff options
author | Julien Valroff <julien@kirya.net> | 2011-05-23 21:05:06 +0200 |
---|---|---|
committer | Julien Valroff <julien@kirya.net> | 2011-05-23 21:05:06 +0200 |
commit | b494e83efd647b035c6bee2fa09a33fa383ef4a3 (patch) | |
tree | a5259813c70e9399c6b3356e236bb9e37ae61c6f /rapid/scan.py | |
parent | 6f8a860aa541b16c84a86cce86c02dd503a3c5c0 (diff) |
Imported Upstream version 0.4.1upstream/0.4.1
Diffstat (limited to 'rapid/scan.py')
-rwxr-xr-x | rapid/scan.py | 56 |
1 files changed, 26 insertions, 30 deletions
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 |