From 59f4d75d78abf0c4b9cb716b0f0e3882844cb3aa Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 20 Dec 2020 16:12:51 +0000 Subject: [PATCH] Avatar file extension --- daemon.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/daemon.py b/daemon.py index 0515cced..61cc8298 100644 --- a/daemon.py +++ b/daemon.py @@ -9066,13 +9066,14 @@ class PubServer(BaseHTTPRequestHandler): if '/' in avatarStr and '.temp.' not in path: avatarNickname = avatarStr.split('/')[0] avatarFile = avatarStr.split('/')[1] + avatarFileExt = avatarFile.split('.')[-1] # remove any numbers, eg. avatar123.png becomes avatar.png if avatarFile.startswith('avatar'): - avatarFile = 'avatar.' + avatarFile.split('.')[1] + avatarFile = 'avatar.' + avatarFileExt if avatarFile.startswith('banner'): - avatarFile = 'banner.' + avatarFile.split('.')[1] + avatarFile = 'banner.' + avatarFileExt elif avatarFile.startswith('image'): - avatarFile = 'image.' + avatarFile.split('.')[1] + avatarFile = 'image.' + avatarFileExt avatarFilename = \ baseDir + '/accounts/' + \ avatarNickname + '@' + domain + '/' + avatarFile