Skip to content

Commit

Permalink
Could not set single Indexer Tag for a category
Browse files Browse the repository at this point in the history
"TV > HD" would become ['TV', '>', 'HD'].
See https://forums.sabnzbd.org/viewtopic.php?f=3&t=23409
  • Loading branch information
Safihre committed May 30, 2018
1 parent 2a113f7 commit 8f248a2
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion sabnzbd/config.py
Expand Up @@ -463,7 +463,7 @@ def __init__(self, name, values):
self.pp = OptionStr(name, 'pp', '', add=False)
self.script = OptionStr(name, 'script', 'Default', add=False)
self.dir = OptionDir(name, 'dir', add=False, create=False)
self.newzbin = OptionList(name, 'newzbin', add=False)
self.newzbin = OptionList(name, 'newzbin', add=False, validation=validate_single_tag)
self.priority = OptionNumber(name, 'priority', DEFAULT_PRIORITY, add=False)

self.set_dict(values)
Expand Down Expand Up @@ -1102,6 +1102,16 @@ def validate_notempty(root, value, default):
return None, default


def validate_single_tag(value):
""" Don't split single indexer tags like "TV > HD"
into ['TV', '>', 'HD']
"""
if len(value) == 3:
if value[1] == '>':
return None, ' '.join(value)
return None, value


def create_api_key():
""" Return a new randomized API_KEY """
# Create some values to seed md5
Expand Down

0 comments on commit 8f248a2

Please sign in to comment.