|
|
@@ -65,9 +65,12 @@ app.secret_key = settings['server']['secret_key']
|
|
65
|
65
|
|
|
66
|
66
|
babel = Babel(app)
|
|
67
|
67
|
|
|
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)
|
|
71
|
74
|
|
|
72
|
75
|
cookie_max_age = 60 * 60 * 24 * 365 * 23 # 23 years
|
|
73
|
76
|
|
|
|
@@ -233,10 +236,6 @@ def index():
|
|
233
|
236
|
else:
|
|
234
|
237
|
result['pretty_url'] = result['url']
|
|
235
|
238
|
|
|
236
|
|
- for engine in result['engines']:
|
|
237
|
|
- if engine in favicons:
|
|
238
|
|
- result['favicon'] = engine
|
|
239
|
|
-
|
|
240
|
239
|
# TODO, check if timezone is calculated right
|
|
241
|
240
|
if 'publishedDate' in result:
|
|
242
|
241
|
result['pubdate'] = result['publishedDate'].strftime('%Y-%m-%d %H:%M:%S%z')
|
|
|
@@ -289,7 +288,8 @@ def index():
|
|
289
|
288
|
suggestions=search.suggestions,
|
|
290
|
289
|
answers=search.answers,
|
|
291
|
290
|
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())]
|
|
293
|
293
|
)
|
|
294
|
294
|
|
|
295
|
295
|
|