mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-14 02:26:53 -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
|
||||
root = 0
|
||||
foundFile = 0
|
||||
uniquePath = 1
|
||||
|
||||
if clientAgent != 'manual' and not nzbtomedia.DOWNLOADINFO:
|
||||
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"])
|
||||
except:
|
||||
nzbtomedia.USER_SCRIPT_RUNONCE = 1
|
||||
try:
|
||||
uniquePath = int(section[usercat]["unique_path"])
|
||||
except:
|
||||
uniquePath = 1
|
||||
|
||||
if clientAgent != 'manual':
|
||||
nzbtomedia.pause_torrent(clientAgent, inputHash, inputID, inputName)
|
||||
|
||||
outputDestination = os.path.normpath(
|
||||
nzbtomedia.os.path.join(nzbtomedia.OUTPUTDIRECTORY, inputCategory, nzbtomedia.sanitizeName(inputName)))
|
||||
if uniquePath:
|
||||
outputDestination = os.path.normpath(
|
||||
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))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue