diff --git a/TorrentToMedia.py b/TorrentToMedia.py index 096f257b..95e99ef1 100755 --- a/TorrentToMedia.py +++ b/TorrentToMedia.py @@ -349,7 +349,7 @@ def main(inputDirectory, inputName, inputCategory, inputHash, inputID): if fileExtension in mediaContainer or fileExtension in metaContainer: num_files_new = num_files_new + 1 file_list.append(file) - if num_files_new == int(0): + if num_files_new == int(0) or forceClean == 1: Logger.info("All files have been processed. Cleaning outputDirectory %s", outputDestination) shutil.rmtree(outputDestination) else: @@ -479,6 +479,7 @@ if __name__ == "__main__": DelugePWD = config.get("Torrent", "DelugePWD") # mysecretpwr deleteOriginal = int(config.get("Torrent", "deleteOriginal")) # 0 + forceClean = int(config.get("Torrent", "forceClean")) # 0 compressedContainer = (config.get("Extensions", "compressedExtensions")).split(',') # .zip,.rar,.7z mediaContainer = (config.get("Extensions", "mediaExtensions")).split(',') # .mkv,.avi,.divx diff --git a/autoProcess/autoProcessMovie.py b/autoProcess/autoProcessMovie.py index 2adbc78e..7c70e66b 100644 --- a/autoProcess/autoProcessMovie.py +++ b/autoProcess/autoProcessMovie.py @@ -337,8 +337,10 @@ def process(dirName, nzbName=None, status=0, clientAgent = "manual", download_id Logger.exception("Unable to delete folder %s", dirName) return 0 # success - if nzbName == "Manual Run" or download_id == "none": + if nzbName == "Manual Run": return 0 # success + if download_id == "none": + return 1 # just to be sure TorrentToMedia doesn't start deleting files as we havent verified changed status. # we will now check to see if CPS has finished renaming before returning to TorrentToMedia and unpausing. socket.setdefaulttimeout(int(TimeOut)) #initialize socket timeout. diff --git a/autoProcessMedia.cfg.sample b/autoProcessMedia.cfg.sample index 3270cbee..42583ff8 100644 --- a/autoProcessMedia.cfg.sample +++ b/autoProcessMedia.cfg.sample @@ -105,6 +105,7 @@ DelugeUSR = your username DelugePWD = your password ###### ADVANCED USE - ONLY EDIT IF YOU KNOW WHAT YOU'RE DOING ###### deleteOriginal = 0 +forceClean = 0 [Extensions] compressedExtensions = .zip,.rar,.7z,.gz,.bz,.tar,.arj,.1,.01,.001 diff --git a/changelog.txt b/changelog.txt index 1c32c18e..534e7ed6 100644 --- a/changelog.txt +++ b/changelog.txt @@ -5,6 +5,7 @@ V9.3 XX/XX/2014 Impacts Torrents Allow Headphones to remove torrents and data after processing. Delete torrent if uselink = move +Added forceClean for outputDir. Works in file permissions prevent CP/SB from moving files. V9.2 05/03/2014