From adf39b6f6acbf57a433a3fe188db7cf515bac4b5 Mon Sep 17 00:00:00 2001 From: shortcutme Date: Sun, 18 Mar 2018 21:26:20 +0100 Subject: [PATCH] Avoid loading user content.json file on isArchived check --- src/Content/ContentManager.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Content/ContentManager.py b/src/Content/ContentManager.py index 3ef6977c..0ff71291 100644 --- a/src/Content/ContentManager.py +++ b/src/Content/ContentManager.py @@ -290,11 +290,13 @@ class ContentManager(object): # Returns if file with the given modification date is archived or not 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: 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: return True else: