mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 22:51:39 +00:00
Removed code duplication among editions in sorting algorithms.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
from hscommon.util import format_size, format_time
|
||||
|
||||
from core.app import (DupeGuru as DupeGuruBase, format_timestamp,
|
||||
format_perc, format_words, format_dupe_count, cmp_value)
|
||||
format_perc, format_words, format_dupe_count)
|
||||
from . import prioritize
|
||||
from . import __appname__
|
||||
from . import scanner, fs
|
||||
@@ -66,24 +66,6 @@ class DupeGuru(DupeGuruBase):
|
||||
'dupe_count': format_dupe_count(dupe_count),
|
||||
}
|
||||
|
||||
def _get_dupe_sort_key(self, dupe, get_group, key, delta):
|
||||
if key == 'percentage':
|
||||
m = get_group().get_match_of(dupe)
|
||||
return m.percentage
|
||||
if key == 'dupe_count':
|
||||
return 0
|
||||
r = cmp_value(dupe, key)
|
||||
if delta and (key in self.result_table.DELTA_COLUMNS):
|
||||
r -= cmp_value(get_group().ref, key)
|
||||
return r
|
||||
|
||||
def _get_group_sort_key(self, group, key):
|
||||
if key == 'percentage':
|
||||
return group.percentage
|
||||
if key == 'dupe_count':
|
||||
return len(group)
|
||||
return cmp_value(group.ref, key)
|
||||
|
||||
def _prioritization_categories(self):
|
||||
return prioritize.all_categories()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user