diff --git a/autoProcessMedia.cfg.spec b/autoProcessMedia.cfg.spec index a4f22362..45f7e53b 100644 --- a/autoProcessMedia.cfg.spec +++ b/autoProcessMedia.cfg.spec @@ -248,6 +248,7 @@ ###### ADVANCED USE - ONLY EDIT IF YOU KNOW WHAT YOU'RE DOING ###### deleteOriginal = 0 chmodDirecotry = 0 + resume = 1 resumeOnFailure = 1 [Extensions] diff --git a/core/__init__.py b/core/__init__.py index e557043b..ba00476f 100644 --- a/core/__init__.py +++ b/core/__init__.py @@ -103,6 +103,7 @@ NOFLATTEN = [] DELETE_ORIGINAL = None TORRENT_CHMOD_DIRECTORY = None TORRENT_DEFAULTDIR = None +TORRENT_RESUME = None TORRENT_RESUME_ON_FAILURE = None REMOTEPATHS = [] @@ -218,7 +219,7 @@ def initialize(section=None): DELETE_ORIGINAL, TORRENT_CHMOD_DIRECTORY, PASSWORDSFILE, USER_DELAY, USER_SCRIPT, USER_SCRIPT_CLEAN, USER_SCRIPT_MEDIAEXTENSIONS, \ USER_SCRIPT_PARAM, USER_SCRIPT_RUNONCE, USER_SCRIPT_SUCCESSCODES, DOWNLOADINFO, CHECK_MEDIA, SAFE_MODE, \ TORRENT_DEFAULTDIR, TORRENT_RESUME_ON_FAILURE, NZB_DEFAULTDIR, REMOTEPATHS, LOG_ENV, PID_FILE, MYAPP, ACHANNELS, ACHANNELS2, ACHANNELS3, \ - PLEXSSL, PLEXHOST, PLEXPORT, PLEXTOKEN, PLEXSEC + PLEXSSL, PLEXHOST, PLEXPORT, PLEXTOKEN, PLEXSEC, TORRENT_RESUME if __INITIALIZED__: return False @@ -346,6 +347,7 @@ def initialize(section=None): DELETE_ORIGINAL = int(CFG["Torrent"]["deleteOriginal"]) TORRENT_CHMOD_DIRECTORY = int(CFG["Torrent"]["chmodDirecotry"], 8) TORRENT_RESUME_ON_FAILURE = int(CFG["Torrent"]["resumeOnFailure"]) + TORRENT_RESUME = int(CFG["Torrent"]["resume"]) UTORRENTWEBUI = CFG["Torrent"]["uTorrentWEBui"] # http://localhost:8090/gui/ UTORRENTUSR = CFG["Torrent"]["uTorrentUSR"] # mysecretusr UTORRENTPWD = CFG["Torrent"]["uTorrentPWD"] # mysecretpwr diff --git a/core/nzbToMediaUtil.py b/core/nzbToMediaUtil.py index 39f7c788..fa1851d5 100644 --- a/core/nzbToMediaUtil.py +++ b/core/nzbToMediaUtil.py @@ -753,6 +753,8 @@ def pause_torrent(clientAgent, inputHash, inputID, inputName): logger.warning("Failed to stop torrent %s in %s" % (inputName, clientAgent)) def resume_torrent(clientAgent, inputHash, inputID, inputName): + if not core.TORRENT_RESUME == 1: + return logger.debug("Starting torrent %s in %s" % (inputName, clientAgent)) try: if clientAgent == 'utorrent' and core.TORRENT_CLASS != "":