diff options
author | Julien Valroff <julien@kirya.net> | 2011-05-23 21:05:08 +0200 |
---|---|---|
committer | Julien Valroff <julien@kirya.net> | 2011-05-23 21:05:08 +0200 |
commit | 85952027591c5da285f924e4d2d013a4493c1845 (patch) | |
tree | d234ed0ee5e97c29f666d0d9580584efb5c8441e /rapid/scan.py | |
parent | 18c39a3fad0f9bf92840f79bcea5d72ed396403d (diff) | |
parent | b494e83efd647b035c6bee2fa09a33fa383ef4a3 (diff) |
Merge commit 'upstream/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 |