forked from indymedia/epicyon
Get the banner file
parent
66a2b87ebe
commit
9c7884ef53
|
@ -3488,6 +3488,8 @@ def htmlProfile(defaultTimeline: str,
|
||||||
cssFile.read().replace('image.png',
|
cssFile.read().replace('image.png',
|
||||||
profileJson['image']['url'])
|
profileJson['image']['url'])
|
||||||
if isSystemAccount(nickname):
|
if isSystemAccount(nickname):
|
||||||
|
bannerFile, bannerFilename = \
|
||||||
|
getBannerFile(baseDir, nickname, domain)
|
||||||
profileStyle = \
|
profileStyle = \
|
||||||
profileStyle.replace('banner.png',
|
profileStyle.replace('banner.png',
|
||||||
'/users/' + nickname + '/' + bannerFile)
|
'/users/' + nickname + '/' + bannerFile)
|
||||||
|
@ -5781,6 +5783,31 @@ def htmlNewswireMobile(baseDir: str, nickname: str,
|
||||||
return htmlStr
|
return htmlStr
|
||||||
|
|
||||||
|
|
||||||
|
def getBannerFile(baseDir: str, nickname: str, domain: str) -> (str, str):
|
||||||
|
"""
|
||||||
|
returns the banner filename
|
||||||
|
"""
|
||||||
|
# filename of the banner shown at the top
|
||||||
|
bannerFile = 'banner.png'
|
||||||
|
bannerFilename = baseDir + '/accounts/' + \
|
||||||
|
nickname + '@' + domain + '/' + bannerFile
|
||||||
|
if not os.path.isfile(bannerFilename):
|
||||||
|
bannerFile = 'banner.jpg'
|
||||||
|
bannerFilename = baseDir + '/accounts/' + \
|
||||||
|
nickname + '@' + domain + '/' + bannerFile
|
||||||
|
if not os.path.isfile(bannerFilename):
|
||||||
|
bannerFile = 'banner.gif'
|
||||||
|
bannerFilename = baseDir + '/accounts/' + \
|
||||||
|
nickname + '@' + domain + '/' + bannerFile
|
||||||
|
if not os.path.isfile(bannerFilename):
|
||||||
|
bannerFile = 'banner.avif'
|
||||||
|
bannerFilename = baseDir + '/accounts/' + \
|
||||||
|
nickname + '@' + domain + '/' + bannerFile
|
||||||
|
if not os.path.isfile(bannerFilename):
|
||||||
|
bannerFile = 'banner.webp'
|
||||||
|
return bannerFile, bannerFilename
|
||||||
|
|
||||||
|
|
||||||
def htmlTimeline(defaultTimeline: str,
|
def htmlTimeline(defaultTimeline: str,
|
||||||
recentPostsCache: {}, maxRecentPosts: int,
|
recentPostsCache: {}, maxRecentPosts: int,
|
||||||
translate: {}, pageNumber: int,
|
translate: {}, pageNumber: int,
|
||||||
|
@ -5856,23 +5883,7 @@ def htmlTimeline(defaultTimeline: str,
|
||||||
cssFilename = baseDir + '/epicyon.css'
|
cssFilename = baseDir + '/epicyon.css'
|
||||||
|
|
||||||
# filename of the banner shown at the top
|
# filename of the banner shown at the top
|
||||||
bannerFile = 'banner.png'
|
bannerFile, bannerFilename = getBannerFile(baseDir, nickname, domain)
|
||||||
bannerFilename = baseDir + '/accounts/' + \
|
|
||||||
nickname + '@' + domain + '/' + bannerFile
|
|
||||||
if not os.path.isfile(bannerFilename):
|
|
||||||
bannerFile = 'banner.jpg'
|
|
||||||
bannerFilename = baseDir + '/accounts/' + \
|
|
||||||
nickname + '@' + domain + '/' + bannerFile
|
|
||||||
if not os.path.isfile(bannerFilename):
|
|
||||||
bannerFile = 'banner.gif'
|
|
||||||
bannerFilename = baseDir + '/accounts/' + \
|
|
||||||
nickname + '@' + domain + '/' + bannerFile
|
|
||||||
if not os.path.isfile(bannerFilename):
|
|
||||||
bannerFile = 'banner.avif'
|
|
||||||
bannerFilename = baseDir + '/accounts/' + \
|
|
||||||
nickname + '@' + domain + '/' + bannerFile
|
|
||||||
if not os.path.isfile(bannerFilename):
|
|
||||||
bannerFile = 'banner.webp'
|
|
||||||
|
|
||||||
# benchmark 1
|
# benchmark 1
|
||||||
timeDiff = int((time.time() - timelineStartTime) * 1000)
|
timeDiff = int((time.time() - timelineStartTime) * 1000)
|
||||||
|
|
Loading…
Reference in New Issue