mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-10 05:34:36 +00:00
[#77 state:fixed] Don't spend time comparing 2 ref files together.
This commit is contained in:
parent
d2e2f337f6
commit
627e638251
@ -216,6 +216,8 @@ def getmatches_by_contents(files, sizeattr='size', partial=False, j=job.nulljob)
|
|||||||
j.start_job(len(possible_matches), '0 matches found')
|
j.start_job(len(possible_matches), '0 matches found')
|
||||||
for group in possible_matches:
|
for group in possible_matches:
|
||||||
for first, second in itertools.combinations(group, 2):
|
for first, second in itertools.combinations(group, 2):
|
||||||
|
if first.is_ref and second.is_ref:
|
||||||
|
continue # Don't spend time comparing two ref pics together.
|
||||||
if first.md5partial == second.md5partial:
|
if first.md5partial == second.md5partial:
|
||||||
if partial or first.md5 == second.md5:
|
if partial or first.md5 == second.md5:
|
||||||
result.append(Match(first, second, 100))
|
result.append(Match(first, second, 100))
|
||||||
|
@ -103,6 +103,9 @@ def getmatches(pictures, cached_blocks, threshold=75, match_scaled=False, j=job.
|
|||||||
for ref in j.iter_with_progress(pictures, 'Matched %d/%d pictures'):
|
for ref in j.iter_with_progress(pictures, 'Matched %d/%d pictures'):
|
||||||
others = pictures_copy if match_scaled else dimensions2pictures[ref.dimensions]
|
others = pictures_copy if match_scaled else dimensions2pictures[ref.dimensions]
|
||||||
others.remove(ref)
|
others.remove(ref)
|
||||||
|
if ref.is_ref:
|
||||||
|
# Don't spend time comparing two ref pics together.
|
||||||
|
others = [pic for pic in others if not pic.is_ref]
|
||||||
if others:
|
if others:
|
||||||
cache_ids = [f.cache_id for f in others]
|
cache_ids = [f.cache_id for f in others]
|
||||||
args = (ref.cache_id, cache_ids, cached_blocks.dbname, threshold)
|
args = (ref.cache_id, cache_ids, cached_blocks.dbname, threshold)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user