mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-02 17:33:37 +00:00
Add base mapping logic for NZBGet.
This commit is contained in:
parent
c9d8fd68aa
commit
1458314c17
3 changed files with 13 additions and 3 deletions
|
@ -268,6 +268,7 @@ NZBGET_HOST = None
|
|||
NZBGET_USE_HTTPS = False
|
||||
NZBGET_PRIORITY = 100
|
||||
NZBGET_SCRIPT_VERSION = None
|
||||
NZBGET_MAP = None
|
||||
|
||||
SAB_USERNAME = None
|
||||
SAB_PASSWORD = None
|
||||
|
@ -615,7 +616,7 @@ def initialize(console_logging=True):
|
|||
# Search Settings/NZB search
|
||||
global USE_NZBS, NZB_METHOD, NZB_DIR, SAB_HOST, SAB_USERNAME, SAB_PASSWORD, SAB_APIKEY, SAB_CATEGORY, \
|
||||
NZBGET_USE_HTTPS, NZBGET_HOST, NZBGET_USERNAME, NZBGET_PASSWORD, NZBGET_CATEGORY, NZBGET_PRIORITY, \
|
||||
NZBGET_SCRIPT_VERSION
|
||||
NZBGET_SCRIPT_VERSION, NZBGET_MAP
|
||||
# Search Settings/Torrent search
|
||||
global USE_TORRENTS, TORRENT_METHOD, TORRENT_DIR, TORRENT_HOST, TORRENT_USERNAME, TORRENT_PASSWORD, \
|
||||
TORRENT_LABEL, TORRENT_PATH, TORRENT_SEED_TIME, TORRENT_PAUSED, TORRENT_HIGH_BANDWIDTH, TORRENT_VERIFY_CERT
|
||||
|
@ -924,6 +925,7 @@ def initialize(console_logging=True):
|
|||
NZBGET_HOST = check_setting_str(CFG, 'NZBget', 'nzbget_host', '')
|
||||
NZBGET_USE_HTTPS = bool(check_setting_int(CFG, 'NZBget', 'nzbget_use_https', 0))
|
||||
NZBGET_PRIORITY = check_setting_int(CFG, 'NZBget', 'nzbget_priority', 100)
|
||||
NZBGET_MAP = check_setting_str(CFG, 'NZBget', 'nzbget_map', '')
|
||||
|
||||
try:
|
||||
ng_script_file = ek.ek(os.path.join, ek.ek(os.path.dirname, ek.ek(os.path.dirname, __file__)),
|
||||
|
@ -1766,6 +1768,7 @@ def save_config():
|
|||
new_config['NZBget']['nzbget_host'] = NZBGET_HOST
|
||||
new_config['NZBget']['nzbget_use_https'] = int(NZBGET_USE_HTTPS)
|
||||
new_config['NZBget']['nzbget_priority'] = NZBGET_PRIORITY
|
||||
new_config['NZBget']['nzbget_map'] = NZBGET_MAP
|
||||
|
||||
new_config['TORRENT'] = {}
|
||||
new_config['TORRENT']['torrent_username'] = TORRENT_USERNAME
|
||||
|
|
|
@ -1728,7 +1728,7 @@ def path_mapper(search, replace, subject):
|
|||
replace = re.sub(r'[\\]', delim, replace)
|
||||
path = re.sub(r'[\\]', delim, subject)
|
||||
result = re.sub('(?i)^%s' % search, replace, path)
|
||||
result = os.path.normpath(re.sub(delim, '/', result))
|
||||
result = ek.ek(os.path.normpath, re.sub(delim, '/', result))
|
||||
|
||||
return result, result != subject
|
||||
|
||||
|
|
|
@ -2996,7 +2996,14 @@ class HomePostProcess(Home):
|
|||
logger.log('Calling SickGear-NG.py script %s is not current version %s, please update.' %
|
||||
(kwargs.get('ppVersion', '0'), sickbeard.NZBGET_SCRIPT_VERSION), logger.ERROR)
|
||||
|
||||
result = processTV.processDir(dir.decode('utf-8') if dir else None, nzbName.decode('utf-8') if nzbName else None,
|
||||
if isinstance(dir, basestring):
|
||||
dir = dir.decode('utf-8')
|
||||
if isinstance(client, basestring) and 'nzbget' == client and \
|
||||
isinstance(sickbeard.NZBGET_MAP, basestring) and sickbeard.NZBGET_MAP:
|
||||
m = sickbeard.NZBGET_MAP.split('=')
|
||||
dir, not_used = helpers.path_mapper(m[0], m[1], dir)
|
||||
|
||||
result = processTV.processDir(dir if dir else None, nzbName.decode('utf-8') if nzbName else None,
|
||||
process_method=process_method, type=type,
|
||||
cleanup='cleanup' in kwargs and kwargs['cleanup'] in ['on', '1'],
|
||||
force=force in ['on', '1'],
|
||||
|
|
Loading…
Reference in a new issue