mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-19 21:03:14 -07:00
added option to disable unique directory in output. Fixes #425
This commit is contained in:
parent
bbd841107d
commit
171eab48d1
2 changed files with 13 additions and 2 deletions
|
@ -14,6 +14,7 @@ def processTorrent(inputDirectory, inputName, inputCategory, inputHash, inputID,
|
||||||
status = 1 # 1 = failed | 0 = success
|
status = 1 # 1 = failed | 0 = success
|
||||||
root = 0
|
root = 0
|
||||||
foundFile = 0
|
foundFile = 0
|
||||||
|
uniquePath = 1
|
||||||
|
|
||||||
if clientAgent != 'manual' and not nzbtomedia.DOWNLOADINFO:
|
if clientAgent != 'manual' and not nzbtomedia.DOWNLOADINFO:
|
||||||
logger.debug('Adding TORRENT download info for directory %s to database' % (inputDirectory))
|
logger.debug('Adding TORRENT download info for directory %s to database' % (inputDirectory))
|
||||||
|
@ -107,12 +108,20 @@ def processTorrent(inputDirectory, inputName, inputCategory, inputHash, inputID,
|
||||||
nzbtomedia.USER_SCRIPT_RUNONCE = int(section[usercat]["user_script_runOnce"])
|
nzbtomedia.USER_SCRIPT_RUNONCE = int(section[usercat]["user_script_runOnce"])
|
||||||
except:
|
except:
|
||||||
nzbtomedia.USER_SCRIPT_RUNONCE = 1
|
nzbtomedia.USER_SCRIPT_RUNONCE = 1
|
||||||
|
try:
|
||||||
|
uniquePath = int(section[usercat]["unique_path"])
|
||||||
|
except:
|
||||||
|
uniquePath = 1
|
||||||
|
|
||||||
if clientAgent != 'manual':
|
if clientAgent != 'manual':
|
||||||
nzbtomedia.pause_torrent(clientAgent, inputHash, inputID, inputName)
|
nzbtomedia.pause_torrent(clientAgent, inputHash, inputID, inputName)
|
||||||
|
|
||||||
|
if uniquePath:
|
||||||
outputDestination = os.path.normpath(
|
outputDestination = os.path.normpath(
|
||||||
nzbtomedia.os.path.join(nzbtomedia.OUTPUTDIRECTORY, inputCategory, nzbtomedia.sanitizeName(inputName)))
|
nzbtomedia.os.path.join(nzbtomedia.OUTPUTDIRECTORY, inputCategory, nzbtomedia.sanitizeName(inputName)))
|
||||||
|
else:
|
||||||
|
outputDestination = os.path.normpath(
|
||||||
|
nzbtomedia.os.path.join(nzbtomedia.OUTPUTDIRECTORY, inputCategory))
|
||||||
|
|
||||||
logger.info("Output directory set to: %s" % (outputDestination))
|
logger.info("Output directory set to: %s" % (outputDestination))
|
||||||
|
|
||||||
|
|
|
@ -281,6 +281,8 @@
|
||||||
#Clean after? Note that delay function is used to prevent possible mistake :) Delay is intended as seconds
|
#Clean after? Note that delay function is used to prevent possible mistake :) Delay is intended as seconds
|
||||||
user_script_clean = 1
|
user_script_clean = 1
|
||||||
delay = 120
|
delay = 120
|
||||||
|
#Unique path (directory) created for every download. set 0 to disable.
|
||||||
|
unique_path = 1
|
||||||
##### Set to path where download client places completed downloads locally for this category
|
##### Set to path where download client places completed downloads locally for this category
|
||||||
watch_dir =
|
watch_dir =
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue