Ignore stray files created by third party processes in the notes restore dir

This commit is contained in:
Kovid Goyal 2024-06-03 22:21:53 +05:30
parent 136df0e6e9
commit f76440fd0e
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -468,7 +468,11 @@ class Notes:
resources = {}
errors = []
for subdir in os.listdir(make_long_path_useable(self.resources_dir)):
for rf in os.listdir(make_long_path_useable(os.path.join(self.resources_dir, subdir))):
try:
subitems = os.listdir(make_long_path_useable(os.path.join(self.resources_dir, subdir)))
except NotADirectoryError:
continue
for rf in subitems:
if not rf.endswith(METADATA_EXT):
name_path = os.path.join(self.resources_dir, subdir, rf + METADATA_EXT)
name = 'unnamed'