From 46d43fcc06792ea9ecf2e32a06c4ebb52ad38785 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 19 Jan 2020 23:39:00 +0000 Subject: [PATCH] Extension can vary --- person.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/person.py b/person.py index 7cc78bc2..1ca2888c 100644 --- a/person.py +++ b/person.py @@ -137,8 +137,12 @@ def randomizeActorImages(personJson: {}) -> None: This causes other instances to update their cached avatar image """ personId=personJson['id'] - personJson['icon']['url']=personId+'/avatar'+str(randint(10000000000000,99999999999999))+'.png' - personJson['image']['url']=personId+'/image'+str(randint(10000000000000,99999999999999))+'.png' + lastPartOfFilename=personJson['icon']['url'].split('/')[-1] + existingExtension=lastPartOfFilename.split('.')[1] + personJson['icon']['url']=personId+'/avatar'+str(randint(10000000000000,99999999999999))+'.'+existingExtension + lastPartOfFilename=personJson['image']['url'].split('/')[-1] + existingExtension=lastPartOfFilename.split('.')[1] + personJson['image']['url']=personId+'/image'+str(randint(10000000000000,99999999999999))+'.'+existingExtension def createPersonBase(baseDir: str,nickname: str,domain: str,port: int, \ httpPrefix: str, saveToFile: bool,password=None) -> (str,str,{},{}):