File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -389,12 +389,12 @@ def get_fs_duplicates(args) -> List[dict]:
389
389
args .db ["media" ].upsert (path_media_map [path ], pk = ["path" ], alter = True ) # save sample-hash back to db
390
390
media = [path_media_map [d ['path' ]] for d in media if d ['path' ] in path_media_map ]
391
391
392
- sample_hash_groups = defaultdict (list )
392
+ sample_hash_groups = defaultdict (set )
393
393
for m in media :
394
- sample_hash_groups [m ["hash" ]].append ( m )
394
+ sample_hash_groups [m ["hash" ]].add ( m [ 'path' ] )
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
+ sample_hash_paths = set . intersection ( * sample_hash_groups )
398
398
log .info (
399
399
"Got %s sample-hash duplicates (%s groups). Doing full hash comparison..." ,
400
400
len (sample_hash_paths ),
You can’t perform that action at this time.
0 commit comments