mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-13 18:16:52 -07:00
Streamline variable assignment
This commit is contained in:
parent
88c9d74206
commit
0c45961382
5 changed files with 7 additions and 31 deletions
|
@ -23,11 +23,7 @@ class autoProcessComics(object):
|
||||||
ssl = int(core.CFG[section][inputCategory].get("ssl", 0))
|
ssl = int(core.CFG[section][inputCategory].get("ssl", 0))
|
||||||
web_root = core.CFG[section][inputCategory].get("web_root", "")
|
web_root = core.CFG[section][inputCategory].get("web_root", "")
|
||||||
remote_path = int(core.CFG[section][inputCategory].get("remote_path"), 0)
|
remote_path = int(core.CFG[section][inputCategory].get("remote_path"), 0)
|
||||||
|
protocol = "https://" if ssl else "http://"
|
||||||
if ssl:
|
|
||||||
protocol = "https://"
|
|
||||||
else:
|
|
||||||
protocol = "http://"
|
|
||||||
|
|
||||||
url = "%s%s:%s%s/post_process" % (protocol, host, port, web_root)
|
url = "%s%s:%s%s/post_process" % (protocol, host, port, web_root)
|
||||||
if not server_responding(url):
|
if not server_responding(url):
|
||||||
|
|
|
@ -21,11 +21,7 @@ class autoProcessGames(object):
|
||||||
library = core.CFG[section][inputCategory].get("library")
|
library = core.CFG[section][inputCategory].get("library")
|
||||||
ssl = int(core.CFG[section][inputCategory].get("ssl", 0))
|
ssl = int(core.CFG[section][inputCategory].get("ssl", 0))
|
||||||
web_root = core.CFG[section][inputCategory].get("web_root", "")
|
web_root = core.CFG[section][inputCategory].get("web_root", "")
|
||||||
|
protocol = "https://" if ssl else "http://"
|
||||||
if ssl:
|
|
||||||
protocol = "https://"
|
|
||||||
else:
|
|
||||||
protocol = "http://"
|
|
||||||
|
|
||||||
url = "%s%s:%s%s/api" % (protocol, host, port, web_root)
|
url = "%s%s:%s%s/api" % (protocol, host, port, web_root)
|
||||||
if not server_responding(url):
|
if not server_responding(url):
|
||||||
|
@ -38,9 +34,7 @@ class autoProcessGames(object):
|
||||||
|
|
||||||
gamezID = fields[0].replace("[", "").replace("]", "").replace(" ", "")
|
gamezID = fields[0].replace("[", "").replace("]", "").replace(" ", "")
|
||||||
|
|
||||||
downloadStatus = 'Wanted'
|
downloadStatus = 'Downloaded' if status == 0 else 'Wanted'
|
||||||
if status == 0:
|
|
||||||
downloadStatus = 'Downloaded'
|
|
||||||
|
|
||||||
params = {
|
params = {
|
||||||
'api_key': apikey,
|
'api_key': apikey,
|
||||||
|
|
|
@ -115,11 +115,7 @@ class autoProcessMovie(object):
|
||||||
web_root = core.CFG[section][inputCategory].get("web_root", "")
|
web_root = core.CFG[section][inputCategory].get("web_root", "")
|
||||||
remote_path = int(core.CFG[section][inputCategory].get("remote_path", 0))
|
remote_path = int(core.CFG[section][inputCategory].get("remote_path", 0))
|
||||||
extract = int(section[inputCategory].get("extract", 0))
|
extract = int(section[inputCategory].get("extract", 0))
|
||||||
|
protocol = "https://" if ssl else "http://"
|
||||||
if ssl:
|
|
||||||
protocol = "https://"
|
|
||||||
else:
|
|
||||||
protocol = "http://"
|
|
||||||
|
|
||||||
baseURL = "%s%s:%s%s/api/%s" % (protocol, host, port, web_root, apikey)
|
baseURL = "%s%s:%s%s/api/%s" % (protocol, host, port, web_root, apikey)
|
||||||
if not server_responding(baseURL):
|
if not server_responding(baseURL):
|
||||||
|
@ -213,9 +209,7 @@ class autoProcessMovie(object):
|
||||||
params['downloader'] = downloader or clientAgent
|
params['downloader'] = downloader or clientAgent
|
||||||
params['download_id'] = download_id
|
params['download_id'] = download_id
|
||||||
|
|
||||||
params['media_folder'] = dirName
|
params['media_folder'] = remoteDir(dirName) if remote_path else dirName
|
||||||
if remote_path:
|
|
||||||
params['media_folder'] = remoteDir(dirName)
|
|
||||||
|
|
||||||
if method == "manage":
|
if method == "manage":
|
||||||
command = "/manage.update"
|
command = "/manage.update"
|
||||||
|
|
|
@ -50,11 +50,7 @@ class autoProcessMusic(object):
|
||||||
web_root = core.CFG[section][inputCategory].get("web_root", "")
|
web_root = core.CFG[section][inputCategory].get("web_root", "")
|
||||||
remote_path = int(core.CFG[section][inputCategory].get("remote_path", 0))
|
remote_path = int(core.CFG[section][inputCategory].get("remote_path", 0))
|
||||||
extract = int(section[inputCategory].get("extract", 0))
|
extract = int(section[inputCategory].get("extract", 0))
|
||||||
|
protocol = "https://" if ssl else "http://"
|
||||||
if ssl:
|
|
||||||
protocol = "https://"
|
|
||||||
else:
|
|
||||||
protocol = "http://"
|
|
||||||
|
|
||||||
url = "%s%s:%s%s/api" % (protocol, host, port, web_root)
|
url = "%s%s:%s%s/api" % (protocol, host, port, web_root)
|
||||||
if not server_responding(url):
|
if not server_responding(url):
|
||||||
|
|
|
@ -56,11 +56,7 @@ class autoProcessTV(object):
|
||||||
port = core.CFG[section][inputCategory]["port"]
|
port = core.CFG[section][inputCategory]["port"]
|
||||||
ssl = int(core.CFG[section][inputCategory].get("ssl", 0))
|
ssl = int(core.CFG[section][inputCategory].get("ssl", 0))
|
||||||
web_root = core.CFG[section][inputCategory].get("web_root", "")
|
web_root = core.CFG[section][inputCategory].get("web_root", "")
|
||||||
|
protocol = "https://" if ssl else "http://"
|
||||||
if ssl:
|
|
||||||
protocol = "https://"
|
|
||||||
else:
|
|
||||||
protocol = "http://"
|
|
||||||
|
|
||||||
if not server_responding("%s%s:%s%s" % (protocol, host, port, web_root)):
|
if not server_responding("%s%s:%s%s" % (protocol, host, port, web_root)):
|
||||||
logger.error("Server did not respond. Exiting", section)
|
logger.error("Server did not respond. Exiting", section)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue