diff --git a/utils.py b/utils.py index 212e7093e..e74d407d1 100644 --- a/utils.py +++ b/utils.py @@ -75,12 +75,12 @@ def saveJson(jsonObject: {}, filename: str) -> bool: return False -def loadJson(filename: str, delaySec=2) -> {}: +def loadJson(filename: str, delaySec=2, maxTries=5) -> {}: """Makes a few attempts to load a json formatted file """ jsonObject = None tries = 0 - while tries < 5: + while tries < maxTries: try: with open(filename, 'r') as fp: data = fp.read() diff --git a/webinterface.py b/webinterface.py index 0c5e41201..5508094c1 100644 --- a/webinterface.py +++ b/webinterface.py @@ -294,6 +294,7 @@ def getPersonAvatarUrl(baseDir: str, personUrl: str, personCache: {}) -> str: personJson = getPersonFromCache(baseDir, personUrl, personCache) if not personJson: return None + # get from locally stored image actorStr = personJson['id'].replace('/', '-') avatarImagePath = baseDir + '/cache/avatars/' + actorStr