From 2fe45d893196dc70f7d438b89984fce48d073431 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 4 May 2020 19:33:13 +0100 Subject: [PATCH] Premature case insensitivity --- webinterface.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/webinterface.py b/webinterface.py index cbdce472a..3452b9307 100644 --- a/webinterface.py +++ b/webinterface.py @@ -255,17 +255,16 @@ def getPersonAvatarUrl(baseDir: str, personUrl: str, personCache: {}) -> str: return None # get from locally stored image actorStr = personJson['id'].replace('/', '-') - avatarImagePath = \ - getFileCaseInsensitive(baseDir + '/cache/avatars/' + actorStr) - if os.path.isfile(avatarImagePath + '.png'): + avatarImagePath = baseDir + '/cache/avatars/' + actorStr + if os.path.isfile(getFileCaseInsensitive((avatarImagePath + '.png')): return '/avatars/' + actorStr + '.png' - elif os.path.isfile(avatarImagePath + '.jpg'): + elif os.path.isfile(getFileCaseInsensitive(avatarImagePath + '.jpg')): return '/avatars/' + actorStr + '.jpg' - elif os.path.isfile(avatarImagePath + '.gif'): + elif os.path.isfile(getFileCaseInsensitive(avatarImagePath + '.gif')): return '/avatars/' + actorStr + '.gif' - elif os.path.isfile(avatarImagePath + '.webp'): + elif os.path.isfile(getFileCaseInsensitive(avatarImagePath + '.webp')): return '/avatars/' + actorStr + '.webp' - elif os.path.isfile(avatarImagePath): + elif os.path.isfile(getFileCaseInsensitive(avatarImagePath)): return '/avatars/' + actorStr if personJson.get('icon'):