Adjust fork detection for force_next and change to proc_dir (fork SICKRAGE was never detected anymore anyways, so I reused that one)

This commit is contained in:
miigotu 2017-01-10 01:47:27 -08:00
commit 9118474770
No known key found for this signature in database
GPG key ID: 349786E31CD0D65C
2 changed files with 25 additions and 11 deletions

View file

@ -54,12 +54,14 @@ FORK_FAILED = "failed"
FORK_FAILED_TORRENT = "failed-torrent" FORK_FAILED_TORRENT = "failed-torrent"
FORK_SICKRAGETV = "sickragetv" FORK_SICKRAGETV = "sickragetv"
FORK_SICKRAGE = "sickrage" FORK_SICKRAGE = "sickrage"
FORK_SICKRAGE2 = "sickrage"
FORKS[FORK_DEFAULT] = {"dir": None} FORKS[FORK_DEFAULT] = {"dir": None}
FORKS[FORK_FAILED] = {"dirName": None, "failed": None} FORKS[FORK_FAILED] = {"dirName": None, "failed": None}
FORKS[FORK_FAILED_TORRENT] = {"dir": None, "failed": None, "process_method": None} FORKS[FORK_FAILED_TORRENT] = {"dir": None, "failed": None, "process_method": None}
FORKS[FORK_SICKRAGETV] = {"proc_dir": None, "failed": None, "process_method": None, "force": None, "delete_on": None} FORKS[FORK_SICKRAGETV] = {"proc_dir": None, "failed": None, "process_method": None, "force": None, "delete_on": None}
FORKS[FORK_SICKRAGE] = {"dir": None, "failed": None, "process_method": None, "force": None, "delete_on": None} FORKS[FORK_SICKRAGE] = {"process_directory": None, "failed": None, "process_method": None, "force": None, "delete_on": None, "force_next": True}
ALL_FORKS = {"dir": None, "dirName": None, "proc_dir": None, "failed": None, "process_method": None, "force": None, "delete_on": None} ALL_FORKS = {"dir": None, "dirName": None, "proc_dir": None, "process_directory": None, "failed": None, "process_method": None, "force": None,
"delete_on": None, "force_next": True}
SICKBEARD_FAILED = [FORK_FAILED, FORK_FAILED_TORRENT, FORK_SICKRAGETV, FORK_SICKRAGE] SICKBEARD_FAILED = [FORK_FAILED, FORK_FAILED_TORRENT, FORK_SICKRAGETV, FORK_SICKRAGE]
SICKBEARD_TORRENT = [FORK_FAILED_TORRENT, FORK_SICKRAGETV, FORK_SICKRAGE] SICKBEARD_TORRENT = [FORK_FAILED_TORRENT, FORK_SICKRAGETV, FORK_SICKRAGE]

View file

@ -15,7 +15,8 @@ from core.transcoder import transcoder
requests.packages.urllib3.disable_warnings() requests.packages.urllib3.disable_warnings()
class autoProcessTV: class autoProcessTV:
def command_complete(self, url, params, headers, section): @staticmethod
def command_complete(url, params, headers, section):
r = None r = None
try: try:
r = requests.get(url, params=params, headers=headers, stream=True, verify=False, timeout=(30, 60)) r = requests.get(url, params=params, headers=headers, stream=True, verify=False, timeout=(30, 60))
@ -110,6 +111,11 @@ class autoProcessTV:
delete_on = int(core.CFG[section][inputCategory]["delete_on"]) delete_on = int(core.CFG[section][inputCategory]["delete_on"])
except: except:
delete_on = 0 delete_on = 0
try:
force_next = int(core.CFG[section][inputCategory]["force_next"])
except:
force_next = 0
try: try:
extract = int(section[inputCategory]["extract"]) extract = int(section[inputCategory]["extract"])
except: except:
@ -200,7 +206,7 @@ class autoProcessTV:
if param == "failed": if param == "failed":
fork_params[param] = failed fork_params[param] = failed
if param in ["dirName", "dir", "proc_dir"]: if param in ["dirName", "dir", "proc_dir", "process_directory"]:
fork_params[param] = dirName fork_params[param] = dirName
if remote_path: if remote_path:
fork_params[param] = remoteDir(dirName) fork_params[param] = remoteDir(dirName)
@ -223,6 +229,12 @@ class autoProcessTV:
else: else:
del fork_params[param] del fork_params[param]
if param == "force_next":
if force_next:
fork_params[param] = force_next
else:
del fork_params[param]
# delete any unused params so we don't pass them to SB by mistake # delete any unused params so we don't pass them to SB by mistake
[fork_params.pop(k) for k,v in fork_params.items() if v is None] [fork_params.pop(k) for k,v in fork_params.items() if v is None]