File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -376,12 +376,12 @@ def get_fs_duplicates(args) -> List[dict]:
376
376
377
377
path_media_map = {d ["path" ]: d for d in media }
378
378
379
- sample_hash_paths = [d ["path" ] for d in media if not d .get ("hash" )]
380
- if sample_hash_paths :
379
+ need_sample_hash_paths = [d ["path" ] for d in media if not d .get ("hash" )]
380
+ if need_sample_hash_paths :
381
381
with ThreadPoolExecutor (max_workers = 20 ) as pool :
382
- hash_results = list (pool .map (sample_hash .sample_hash_file , sample_hash_paths ))
382
+ hash_results = list (pool .map (sample_hash .sample_hash_file , need_sample_hash_paths ))
383
383
384
- for path , hash in zip (sample_hash_paths , hash_results ):
384
+ for path , hash in zip (need_sample_hash_paths , hash_results ):
385
385
if hash is None :
386
386
del path_media_map [path ]
387
387
else :
@@ -394,9 +394,10 @@ def get_fs_duplicates(args) -> List[dict]:
394
394
sample_hash_groups [m ["hash" ]].append (m )
395
395
sample_hash_groups = [l for l in sample_hash_groups .values () if len (l ) > 1 ]
396
396
397
+ sample_hash_paths = {d ["path" ] for g in sample_hash_groups for d in g }
397
398
log .info (
398
399
"Got %s sample-hash duplicates (%s groups). Doing full hash comparison..." ,
399
- len (list ( iterables . flatten ( sample_hash_groups )) ),
400
+ len (sample_hash_paths ),
400
401
len (sample_hash_groups ),
401
402
)
402
403
You can’t perform that action at this time.
0 commit comments