@@ -65,9 +65,12 @@ app.secret_key = settings['server']['secret_key']
6565
6666babel = Babel(app)
6767
68−#TODO configurable via settings.yml
69−favicons = ['wikipedia', 'youtube', 'vimeo', 'dailymotion', 'soundcloud',
70− 'twitter', 'stackoverflow', 'github', 'deviantart', 'kickass']
68+global_favicons = []
69+for indice, theme in enumerate(themes):
70+ global_favicons.append([])
71+ theme_img_path = searx_dir+"/static/"+theme+"/img/"
72+ for (dirpath, dirnames, filenames) in os.walk(theme_img_path):
73+ global_favicons[indice].extend(filenames)
7174
7275cookie_max_age = 60 * 60 * 24 * 365 * 23 # 23 years
7376
@@ -233,10 +236,6 @@ def index():
233236 else:
234237 result['pretty_url'] = result['url']
235238
236− for engine in result['engines']:
237− if engine in favicons:
238− result['favicon'] = engine
239−
240239 # TODO, check if timezone is calculated right
241240 if 'publishedDate' in result:
242241 result['pubdate'] = result['publishedDate'].strftime('%Y-%m-%d %H:%M:%S%z')
@@ -289,7 +288,8 @@ def index():
289288 suggestions=search.suggestions,
290289 answers=search.answers,
291290 infoboxes=search.infoboxes,
292− theme=get_current_theme_name()
291+ theme=get_current_theme_name(),
292+ favicons=global_favicons[themes.index(get_current_theme_name())]
293293 )
294294
295295