diff --git a/TorrentToMedia.py b/TorrentToMedia.py index 3cb18daf..6fd691c0 100755 --- a/TorrentToMedia.py +++ b/TorrentToMedia.py @@ -223,7 +223,9 @@ def processTorrent(inputDirectory, inputName, inputCategory, inputHash, inputID, plex_update(inputCategory) if result[0] != 0: - if clientAgent != 'manual': + if core.TORRENT_RESUME_ON_FAILURE: + logger.error("A problem was reported in the autoProcess* script. torrent won't resume seeding (settings)") + elif clientAgent != 'manual': logger.error( "A problem was reported in the autoProcess* script. If torrent was paused we will resume seeding") core.resume_torrent(clientAgent, inputHash, inputID, inputName) diff --git a/autoProcessMedia.cfg.spec b/autoProcessMedia.cfg.spec index 46e6a2ea..a9d848db 100644 --- a/autoProcessMedia.cfg.spec +++ b/autoProcessMedia.cfg.spec @@ -240,6 +240,7 @@ ###### ADVANCED USE - ONLY EDIT IF YOU KNOW WHAT YOU'RE DOING ###### deleteOriginal = 0 chmodDirecotry = 0 + resumeOnFailure = 1 [Extensions] compressedExtensions = .zip,.rar,.7z,.gz,.bz,.tar,.arj,.1,.01,.001 diff --git a/core/__init__.py b/core/__init__.py index 6a64adf4..3c4a3244 100644 --- a/core/__init__.py +++ b/core/__init__.py @@ -100,6 +100,7 @@ NOFLATTEN = [] DELETE_ORIGINAL = None TORRENT_CHMOD_DIRECTORY = None TORRENT_DEFAULTDIR = None +TORRENT_RESUME_ON_FAILURE = None REMOTEPATHS = [] @@ -213,7 +214,7 @@ def initialize(section=None): NICENESS, LOG_DEBUG, FORCE_CLEAN, FFMPEG_PATH, FFMPEG, FFPROBE, AUDIOCONTAINER, EXTCONTAINER, TORRENT_CLASS, \ 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, NZB_DEFAULTDIR, REMOTEPATHS, LOG_ENV, PID_FILE, MYAPP, ACHANNELS, ACHANNELS2, ACHANNELS3, \ + TORRENT_DEFAULTDIR, TORRENT_RESUME_ON_FAILURE, NZB_DEFAULTDIR, REMOTEPATHS, LOG_ENV, PID_FILE, MYAPP, ACHANNELS, ACHANNELS2, ACHANNELS3, \ PLEXSSL, PLEXHOST, PLEXPORT, PLEXTOKEN, PLEXSEC if __INITIALIZED__: @@ -341,6 +342,7 @@ def initialize(section=None): if isinstance(CATEGORIES, str): CATEGORIES = CATEGORIES.split(',') DELETE_ORIGINAL = int(CFG["Torrent"]["deleteOriginal"]) TORRENT_CHMOD_DIRECTORY = int(CFG["Torrent"]["chmodDirecotry"], 8) + TORRENT_RESUME_ON_FAILURE = int(CFG["Torrent"]["resumeOnFailure"]) UTORRENTWEBUI = CFG["Torrent"]["uTorrentWEBui"] # http://localhost:8090/gui/ UTORRENTUSR = CFG["Torrent"]["uTorrentUSR"] # mysecretusr UTORRENTPWD = CFG["Torrent"]["uTorrentPWD"] # mysecretpwr