add an option to disable resuming of torrents. #892

Thanks @VinceVal
This commit is contained in:
clinton-hall 2015-12-05 10:05:08 +10:30
commit c77ce99ed7
3 changed files with 6 additions and 1 deletions

View file

@ -248,6 +248,7 @@
###### ADVANCED USE - ONLY EDIT IF YOU KNOW WHAT YOU'RE DOING ######
deleteOriginal = 0
chmodDirecotry = 0
resume = 1
resumeOnFailure = 1
[Extensions]

View file

@ -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

View file

@ -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 != "":