@@ -71,6 +71,13 @@ babel = Babel(app)
71#TODO configurable via settings.yml
71#TODO configurable via settings.yml
72favicons = ['wikipedia', 'youtube', 'vimeo', 'dailymotion', 'soundcloud',
72favicons = ['wikipedia', 'youtube', 'vimeo', 'dailymotion', 'soundcloud',
73 'twitter', 'stackoverflow', 'github', 'deviantart']
73 'twitter', 'stackoverflow', 'github', 'deviantart']
76+for indice,theme in enumerate(themes):
77+ global_favicons.append([])
78+ theme_img_path = searx_dir+"/static/"+theme+"/img/"
79+ for (dirpath, dirnames, filenames) in os.walk(theme_img_path):
80+ global_favicons[indice].extend(filenames)
75cookie_max_age = 60 * 60 * 24 * 365 * 23 # 23 years
82cookie_max_age = 60 * 60 * 24 * 365 * 23 # 23 years
@@ -292,11 +299,6 @@ def index():
292 if engine in favicons:
299 if engine in favicons:
293 result['favicon'] = engine
300 result['favicon'] = engine
295− mypath = searx_dir+"/static/"+get_current_theme_name()+"/img/"
297− for (dirpath, dirnames, filenames) in os.walk(mypath):
298− favs.extend(filenames)
300 # TODO, check if timezone is calculated right
302 # TODO, check if timezone is calculated right
301 if 'publishedDate' in result:
303 if 'publishedDate' in result:
302 result['pubdate'] = result['publishedDate'].strftime('%Y-%m-%d %H:%M:%S%z')
304 result['pubdate'] = result['publishedDate'].strftime('%Y-%m-%d %H:%M:%S%z')
@@ -350,7 +352,7 @@ def index():
350 answers=search.answers,
352 answers=search.answers,
351 infoboxes=search.infoboxes,
353 infoboxes=search.infoboxes,
352 theme=get_current_theme_name(),
354 theme=get_current_theme_name(),
353− favicons=favs
355+ favicons=global_favicons[themes.index(get_current_theme_name())]