mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-07-30 11:38:30 -07:00
added forceClean for outputDirectory.
This commit is contained in:
parent
cd8607e42e
commit
a1f659e21e
4 changed files with 7 additions and 2 deletions
|
@ -349,7 +349,7 @@ def main(inputDirectory, inputName, inputCategory, inputHash, inputID):
|
||||||
if fileExtension in mediaContainer or fileExtension in metaContainer:
|
if fileExtension in mediaContainer or fileExtension in metaContainer:
|
||||||
num_files_new = num_files_new + 1
|
num_files_new = num_files_new + 1
|
||||||
file_list.append(file)
|
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)
|
Logger.info("All files have been processed. Cleaning outputDirectory %s", outputDestination)
|
||||||
shutil.rmtree(outputDestination)
|
shutil.rmtree(outputDestination)
|
||||||
else:
|
else:
|
||||||
|
@ -479,6 +479,7 @@ if __name__ == "__main__":
|
||||||
DelugePWD = config.get("Torrent", "DelugePWD") # mysecretpwr
|
DelugePWD = config.get("Torrent", "DelugePWD") # mysecretpwr
|
||||||
|
|
||||||
deleteOriginal = int(config.get("Torrent", "deleteOriginal")) # 0
|
deleteOriginal = int(config.get("Torrent", "deleteOriginal")) # 0
|
||||||
|
forceClean = int(config.get("Torrent", "forceClean")) # 0
|
||||||
|
|
||||||
compressedContainer = (config.get("Extensions", "compressedExtensions")).split(',') # .zip,.rar,.7z
|
compressedContainer = (config.get("Extensions", "compressedExtensions")).split(',') # .zip,.rar,.7z
|
||||||
mediaContainer = (config.get("Extensions", "mediaExtensions")).split(',') # .mkv,.avi,.divx
|
mediaContainer = (config.get("Extensions", "mediaExtensions")).split(',') # .mkv,.avi,.divx
|
||||||
|
|
|
@ -337,8 +337,10 @@ def process(dirName, nzbName=None, status=0, clientAgent = "manual", download_id
|
||||||
Logger.exception("Unable to delete folder %s", dirName)
|
Logger.exception("Unable to delete folder %s", dirName)
|
||||||
return 0 # success
|
return 0 # success
|
||||||
|
|
||||||
if nzbName == "Manual Run" or download_id == "none":
|
if nzbName == "Manual Run":
|
||||||
return 0 # success
|
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.
|
# we will now check to see if CPS has finished renaming before returning to TorrentToMedia and unpausing.
|
||||||
socket.setdefaulttimeout(int(TimeOut)) #initialize socket timeout.
|
socket.setdefaulttimeout(int(TimeOut)) #initialize socket timeout.
|
||||||
|
|
|
@ -105,6 +105,7 @@ DelugeUSR = your username
|
||||||
DelugePWD = your password
|
DelugePWD = your password
|
||||||
###### ADVANCED USE - ONLY EDIT IF YOU KNOW WHAT YOU'RE DOING ######
|
###### ADVANCED USE - ONLY EDIT IF YOU KNOW WHAT YOU'RE DOING ######
|
||||||
deleteOriginal = 0
|
deleteOriginal = 0
|
||||||
|
forceClean = 0
|
||||||
|
|
||||||
[Extensions]
|
[Extensions]
|
||||||
compressedExtensions = .zip,.rar,.7z,.gz,.bz,.tar,.arj,.1,.01,.001
|
compressedExtensions = .zip,.rar,.7z,.gz,.bz,.tar,.arj,.1,.01,.001
|
||||||
|
|
|
@ -5,6 +5,7 @@ V9.3 XX/XX/2014
|
||||||
Impacts Torrents
|
Impacts Torrents
|
||||||
Allow Headphones to remove torrents and data after processing.
|
Allow Headphones to remove torrents and data after processing.
|
||||||
Delete torrent if uselink = move
|
Delete torrent if uselink = move
|
||||||
|
Added forceClean for outputDir. Works in file permissions prevent CP/SB from moving files.
|
||||||
|
|
||||||
V9.2 05/03/2014
|
V9.2 05/03/2014
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue