Getting default images

main
Bob Mottram 2021-08-21 14:03:28 +01:00
parent beb3e93386
commit 6e9561db58
1 changed files with 10 additions and 0 deletions

View File

@ -475,6 +475,16 @@ def _getImageFile(baseDir: str, name: str, directory: str,
bannerFile = name + '_' + theme + '.' + ext
bannerFilename = bannerFilenameTest
return bannerFile, bannerFilename
# if not found then use the default image
theme = 'default'
directory = baseDir + '/theme/' + theme
for ext in bannerExtensions:
bannerFileTest = name + '.' + ext
bannerFilenameTest = directory + '/' + bannerFileTest
if os.path.isfile(bannerFilenameTest):
bannerFile = name + '_' + theme + '.' + ext
bannerFilename = bannerFilenameTest
break
return bannerFile, bannerFilename