Use dashes

main2
Bob Mottram 2019-09-14 19:00:03 +01:00
parent aaa396b6c9
commit 7e4982e165
1 changed files with 4 additions and 4 deletions

View File

@ -49,13 +49,13 @@ def updateAvatarImageCache(session,baseDir: str,httpPrefix: str,actor: str,avata
return None return None
if avatarUrl.endswith('.png'): if avatarUrl.endswith('.png'):
sessionHeaders = {'Accept': 'image/png'} sessionHeaders = {'Accept': 'image/png'}
avatarImageFilename=baseDir+'/cache/avatars/'+actor.replace('/','#')+'.png' avatarImageFilename=baseDir+'/cache/avatars/'+actor.replace('/','-')+'.png'
elif avatarUrl.endswith('.jpg') or avatarUrl.endswith('.jpeg'): elif avatarUrl.endswith('.jpg') or avatarUrl.endswith('.jpeg'):
sessionHeaders = {'Accept': 'image/jpeg'} sessionHeaders = {'Accept': 'image/jpeg'}
avatarImageFilename=baseDir+'/cache/avatars/'+actor.replace('/','#')+'.jpg' avatarImageFilename=baseDir+'/cache/avatars/'+actor.replace('/','-')+'.jpg'
elif avatarUrl.endswith('.gif'): elif avatarUrl.endswith('.gif'):
sessionHeaders = {'Accept': 'image/gif'} sessionHeaders = {'Accept': 'image/gif'}
avatarImageFilename=baseDir+'/cache/avatars/'+actor.replace('/','#')+'.gif' avatarImageFilename=baseDir+'/cache/avatars/'+actor.replace('/','-')+'.gif'
else: else:
return None return None
if not os.path.isfile(avatarImageFilename) or force: if not os.path.isfile(avatarImageFilename) or force:
@ -82,7 +82,7 @@ def getPersonAvatarUrl(baseDir: str,personUrl: str,personCache: {}) -> str:
""" """
personJson = getPersonFromCache(baseDir,personUrl,personCache) personJson = getPersonFromCache(baseDir,personUrl,personCache)
if personJson: if personJson:
actorStr=personJson['id'].replace('/','#') actorStr=personJson['id'].replace('/','-')
avatarImageFilename=baseDir+'/cache/avatars/'+actorStr+'.png' avatarImageFilename=baseDir+'/cache/avatars/'+actorStr+'.png'
if os.path.isfile(avatarImageFilename): if os.path.isfile(avatarImageFilename):
return '/avatars/'+actorStr+'.png' return '/avatars/'+actorStr+'.png'