Skip to content

Commit 4a65951

Browse files
committed
dedupe
1 parent 84da955 commit 4a65951

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

xklb/media/dedupe.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ def get_fs_duplicates(args) -> List[dict]:
366366
size_groups[m['size']].append(m)
367367
size_groups = [l for l in size_groups.values() if len(l) > 1]
368368

369-
size_paths = list(iterables.flatten(size_groups))
369+
size_paths = [d['path'] for g in size_groups for d in g]
370370
media = [d for d in media if d['path'] in size_paths]
371371
log.info(
372372
'Got %s size matches (%s dup groups). Doing sample-hash comparison...',
@@ -381,7 +381,7 @@ def get_fs_duplicates(args) -> List[dict]:
381381
for m in media:
382382
if m['path'] == path:
383383
if hash is None:
384-
media = [ d for d in media if d['path'] != m['path'] ]
384+
media = [ d for d in media if d['path'] != path ]
385385
else:
386386
m['hash'] = hash
387387
args.db["media"].upsert(m, pk=["path"], alter=True) # save sample-hash back to db

0 commit comments

Comments
 (0)