Browse Source

Strip slash of the end of url_base as it breaks the code

Closes #1590
tags/3.1.0Beta1
Safihre 5 years ago
parent
commit
30185d1dbe
  1. 3
      sabnzbd/cfg.py
  2. 7
      sabnzbd/config.py

3
sabnzbd/cfg.py

@ -34,6 +34,7 @@ from sabnzbd.config import (
create_api_key,
validate_notempty,
clean_nice_ionice_parameters,
validate_strip_right_slash,
)
from sabnzbd.constants import (
DEF_HOST,
@ -290,7 +291,7 @@ history_limit = OptionNumber("misc", "history_limit", 10, 0)
wait_ext_drive = OptionNumber("misc", "wait_ext_drive", 5, 1, 60)
marker_file = OptionStr("misc", "nomedia_marker", "")
ipv6_servers = OptionNumber("misc", "ipv6_servers", 1, 0, 2)
url_base = OptionStr("misc", "url_base", "/sabnzbd")
url_base = OptionStr("misc", "url_base", "/sabnzbd", validation=validate_strip_right_slash)
host_whitelist = OptionList("misc", "host_whitelist", validation=all_lowercase)
max_url_retries = OptionNumber("misc", "max_url_retries", 10, 1)

7
sabnzbd/config.py

@ -1121,6 +1121,13 @@ def validate_notempty(root, value, default):
return None, default
def validate_strip_right_slash(value):
"""Strips the right slash"""
if value:
return None, value.rstrip("/")
return None, value
def validate_single_tag(value):
"""Don't split single indexer tags like "TV > HD"
into ['TV', '>', 'HD']

Loading…
Cancel
Save