Avoid loading user content.json file on isArchived check

This commit is contained in:
shortcutme 2018-03-18 21:26:20 +01:00
parent ad1d81dccf
commit adf39b6f6a
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -290,11 +290,13 @@ class ContentManager(object):
# Returns if file with the given modification date is archived or not # Returns if file with the given modification date is archived or not
def isArchived(self, inner_path, modified): def isArchived(self, inner_path, modified):
file_info = self.getFileInfo(inner_path) match = re.match("(.*)/(.*?)/", inner_path)
match = re.match(".*/(.*?)/", inner_path)
if not match: if not match:
return False return False
relative_directory = match.group(1) user_contents_inner_path = match.group(1) + "/content.json"
relative_directory = match.group(2)
file_info = self.getFileInfo(user_contents_inner_path)
if file_info and file_info.get("archived", {}).get(relative_directory) >= modified: if file_info and file_info.get("archived", {}).get(relative_directory) >= modified:
return True return True
else: else: