mirror of https://gitlab.com/bashrc2/epicyon
Default to jpg cached avatars
parent
bbb544f373
commit
b79703dbfd
|
@ -1092,7 +1092,9 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
elif mediaFilename.endswith('.gif'):
|
||||
self._set_headers('image/gif',len(mediaBinary),cookie)
|
||||
else:
|
||||
self._404()
|
||||
# default to jpeg
|
||||
self._set_headers('image/jpeg',len(mediaBinary),cookie)
|
||||
#self._404()
|
||||
return
|
||||
tries=0
|
||||
while tries<5:
|
||||
|
|
|
@ -109,15 +109,18 @@ def getPersonAvatarUrl(baseDir: str,personUrl: str,personCache: {}) -> str:
|
|||
if personJson:
|
||||
# get from locally stored image
|
||||
actorStr=personJson['id'].replace('/','-')
|
||||
avatarImageFilename=baseDir+'/cache/avatars/'+actorStr+'.png'
|
||||
avatarImagePath=baseDir+'/cache/avatars/'+actorStr
|
||||
avatarImageFilename=avatarImagePath+'.png'
|
||||
if os.path.isfile(avatarImageFilename):
|
||||
return '/avatars/'+actorStr+'.png'
|
||||
avatarImageFilename=baseDir+'/cache/avatars/'+actorStr+'.jpg'
|
||||
avatarImageFilename=avatarImagePath+'.jpg'
|
||||
if os.path.isfile(avatarImageFilename):
|
||||
return '/avatars/'+actorStr+'.jpg'
|
||||
avatarImageFilename=baseDir+'/cache/avatars/'+actorStr+'.gif'
|
||||
avatarImageFilename=avatarImagePath+'.gif'
|
||||
if os.path.isfile(avatarImageFilename):
|
||||
return '/avatars/'+actorStr+'.gif'
|
||||
if os.path.isfile(avatarImagePath):
|
||||
return '/avatars/'+actorStr
|
||||
|
||||
if personJson.get('icon'):
|
||||
if personJson['icon'].get('url'):
|
||||
|
|
Loading…
Reference in New Issue