diff --git a/TorrentToMedia.py b/TorrentToMedia.py index ee56d42a..8e45a586 100755 --- a/TorrentToMedia.py +++ b/TorrentToMedia.py @@ -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)) diff --git a/autoProcessMedia.cfg.spec b/autoProcessMedia.cfg.spec index ce57d8f4..43c1be19 100644 --- a/autoProcessMedia.cfg.spec +++ b/autoProcessMedia.cfg.spec @@ -281,6 +281,8 @@ #Clean after? Note that delay function is used to prevent possible mistake :) Delay is intended as seconds user_script_clean = 1 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 watch_dir =