continue if failed to connect to torrent client.

This commit is contained in:
clinton-hall 2015-01-17 12:12:26 +10:30
commit d5cdf2ad69

View file

@ -95,7 +95,10 @@ def processTorrent(inputDirectory, inputName, inputCategory, inputHash, inputID,
uniquePath = 1
if clientAgent != 'manual':
nzbtomedia.pause_torrent(clientAgent, inputHash, inputID, inputName)
try:
nzbtomedia.pause_torrent(clientAgent, inputHash, inputID, inputName)
except:
logger.warning("Failed to pause torrent %s in %s" % (inputName, clientAgent))
if uniquePath:
outputDestination = os.path.normpath(
@ -221,14 +224,20 @@ def processTorrent(inputDirectory, inputName, inputCategory, inputHash, inputID,
if clientAgent != 'manual':
logger.error(
"A problem was reported in the autoProcess* script. If torrent was paused we will resume seeding")
nzbtomedia.resume_torrent(clientAgent, inputHash, inputID, inputName)
try:
nzbtomedia.resume_torrent(clientAgent, inputHash, inputID, inputName)
except:
logger.warning("Failed to resume torrent %s in %s" % (inputName, clientAgent))
else:
if clientAgent != 'manual':
# update download status in our DB
nzbtomedia.update_downloadInfoStatus(inputName, 1)
# remove torrent
nzbtomedia.remove_torrent(clientAgent, inputHash, inputID, inputName)
try:
nzbtomedia.remove_torrent(clientAgent, inputHash, inputID, inputName)
except:
logger.warning("Failed to delete torrent %s in %s" % (inputName, clientAgent))
if not sectionName == 'UserScript': # for user script, we assume this is cleaned by the script or option USER_SCRIPT_CLEAN
# cleanup our processing folders of any misc unwanted files and empty directories