mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-10 05:34:36 +00:00
[#90 state:fixed] Fixed a rare crash on results loading.
This commit is contained in:
parent
0491aa9f6e
commit
88334acdef
10
core/app.py
10
core/app.py
@ -90,8 +90,14 @@ class DupeGuru(RegistrableApplication, Broadcaster):
|
|||||||
j = j.start_subjob([1, 9])
|
j = j.start_subjob([1, 9])
|
||||||
self.results.load_from_xml(op.join(self.appdata, 'last_results.xml'), self._get_file, j)
|
self.results.load_from_xml(op.join(self.appdata, 'last_results.xml'), self._get_file, j)
|
||||||
files = flatten(g[:] for g in self.results.groups)
|
files = flatten(g[:] for g in self.results.groups)
|
||||||
for file in j.iter_with_progress(files, 'Reading metadata %d/%d'):
|
try:
|
||||||
file._read_all_info(attrnames=self.data.METADATA_TO_READ)
|
for file in j.iter_with_progress(files, 'Reading metadata %d/%d'):
|
||||||
|
file._read_all_info(attrnames=self.data.METADATA_TO_READ)
|
||||||
|
except OSError:
|
||||||
|
# If this error is raised, it means that a file was deleted while we were reading
|
||||||
|
# metadata. Proper handling of this rare occurrence is complex because there's no easy
|
||||||
|
# way to remove an arbitrary file from the Results. Thus, we simply clear them.
|
||||||
|
self.results.groups = []
|
||||||
|
|
||||||
def _get_display_info(self, dupe, group, delta=False):
|
def _get_display_info(self, dupe, group, delta=False):
|
||||||
if (dupe is None) or (group is None):
|
if (dupe is None) or (group is None):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user