on master help sign in
Add a variable with all the icons of the theme
0bfc793Cqoicebordel
searx/webapp.py+7−1
@@ -291,6 +291,11 @@ def index():
291 for engine in result['engines']:
291 for engine in result['engines']:
292 if engine in favicons:
292 if engine in favicons:
293 result['favicon'] = engine
293 result['favicon'] = engine
294+
295+ mypath = searx_dir+"/static/"+get_current_theme_name()+"/img/"
296+ favs=[]
297+ for (dirpath, dirnames, filenames) in os.walk(mypath):
298+ favs.extend(filenames)
294
299
295 # TODO, check if timezone is calculated right
300 # TODO, check if timezone is calculated right
296 if 'publishedDate' in result:
301 if 'publishedDate' in result:
@@ -344,7 +349,8 @@ def index():
344 suggestions=search.suggestions,
349 suggestions=search.suggestions,
345 answers=search.answers,
350 answers=search.answers,
346 infoboxes=search.infoboxes,
351 infoboxes=search.infoboxes,
347− theme=get_current_theme_name()
352+ theme=get_current_theme_name(),
353+ favicons=favs
348 )
354 )
349
355
350
356