mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-10 05:34:36 +00:00
Merge pull request #911 from glubsy/fix_757_fix_regression
Fix infinite recursion
This commit is contained in:
commit
e3828ae2ca
@ -770,6 +770,8 @@ class DupeGuru(Broadcaster):
|
|||||||
for group in self.results.groups:
|
for group in self.results.groups:
|
||||||
if group.prioritize(key_func=sort_key):
|
if group.prioritize(key_func=sort_key):
|
||||||
count += 1
|
count += 1
|
||||||
|
if count:
|
||||||
|
self.results.refresh_required = True
|
||||||
self._results_changed()
|
self._results_changed()
|
||||||
msg = tr("{} duplicate groups were changed by the re-prioritization.").format(
|
msg = tr("{} duplicate groups were changed by the re-prioritization.").format(
|
||||||
count
|
count
|
||||||
|
@ -52,6 +52,7 @@ class Results(Markable):
|
|||||||
self.app = app
|
self.app = app
|
||||||
self.problems = [] # (dupe, error_msg)
|
self.problems = [] # (dupe, error_msg)
|
||||||
self.is_modified = False
|
self.is_modified = False
|
||||||
|
self.refresh_required = False
|
||||||
|
|
||||||
def _did_mark(self, dupe):
|
def _did_mark(self, dupe):
|
||||||
self.__marked_size += dupe.size
|
self.__marked_size += dupe.size
|
||||||
@ -94,21 +95,23 @@ class Results(Markable):
|
|||||||
|
|
||||||
# ---Private
|
# ---Private
|
||||||
def __get_dupe_list(self):
|
def __get_dupe_list(self):
|
||||||
self.__dupes = flatten(group.dupes for group in self.groups)
|
if self.__dupes is None or self.refresh_required:
|
||||||
if None in self.__dupes:
|
self.__dupes = flatten(group.dupes for group in self.groups)
|
||||||
# This is debug logging to try to figure out #44
|
self.refresh_required = False
|
||||||
logging.warning(
|
if None in self.__dupes:
|
||||||
"There is a None value in the Results' dupe list. dupes: %r groups: %r",
|
# This is debug logging to try to figure out #44
|
||||||
self.__dupes,
|
logging.warning(
|
||||||
self.groups,
|
"There is a None value in the Results' dupe list. dupes: %r groups: %r",
|
||||||
)
|
self.__dupes,
|
||||||
if self.__filtered_dupes:
|
self.groups,
|
||||||
self.__dupes = [
|
)
|
||||||
dupe for dupe in self.__dupes if dupe in self.__filtered_dupes
|
if self.__filtered_dupes:
|
||||||
]
|
self.__dupes = [
|
||||||
sd = self.__dupes_sort_descriptor
|
dupe for dupe in self.__dupes if dupe in self.__filtered_dupes
|
||||||
if sd:
|
]
|
||||||
self.sort_dupes(sd[0], sd[1], sd[2])
|
sd = self.__dupes_sort_descriptor
|
||||||
|
if sd:
|
||||||
|
self.sort_dupes(sd[0], sd[1], sd[2])
|
||||||
return self.__dupes
|
return self.__dupes
|
||||||
|
|
||||||
def __get_groups(self):
|
def __get_groups(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user