Merge branch 'master' into add_sponsorblock
This commit is contained in:
32
settings.py
32
settings.py
@@ -160,6 +160,19 @@ For security reasons, enabling this is not recommended.''',
|
||||
],
|
||||
}),
|
||||
|
||||
('font', {
|
||||
'type': int,
|
||||
'default': 1,
|
||||
'comment': '',
|
||||
'options': [
|
||||
(0, 'Browser default'),
|
||||
(1, 'Arial'),
|
||||
(2, 'Liberation Serif'),
|
||||
(3, 'Verdana'),
|
||||
(4, 'Tahoma'),
|
||||
],
|
||||
}),
|
||||
|
||||
('autocheck_subscriptions', {
|
||||
'type': bool,
|
||||
'default': 0,
|
||||
@@ -319,12 +332,6 @@ else:
|
||||
globals().update(current_settings_dict)
|
||||
|
||||
|
||||
if proxy_images:
|
||||
img_prefix = "/"
|
||||
else:
|
||||
img_prefix = ""
|
||||
|
||||
|
||||
|
||||
if route_tor:
|
||||
print("Tor routing is ON")
|
||||
@@ -343,6 +350,19 @@ def add_setting_changed_hook(setting, func):
|
||||
hooks[setting] = [func]
|
||||
|
||||
|
||||
def set_img_prefix(old_value=None, value=None):
|
||||
global img_prefix
|
||||
if value is None:
|
||||
value = proxy_images
|
||||
if value:
|
||||
img_prefix = '/'
|
||||
else:
|
||||
img_prefix = ''
|
||||
set_img_prefix()
|
||||
add_setting_changed_hook('proxy_images', set_img_prefix)
|
||||
|
||||
|
||||
|
||||
def settings_page():
|
||||
if request.method == 'GET':
|
||||
return flask.render_template('settings.html',
|
||||
|
||||
Reference in New Issue
Block a user