mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-14 02:26:53 -07:00
Fixed torrent file handling
torrents sometimes comes as single file, however, processors (Sickbeard for example) are expecting isolated folder. This patch will make sure that if processed item is not a directory, then it will create a directory (similar to file name) and move the media there.
This commit is contained in:
parent
0d1e27c093
commit
96dfe7d765
1 changed files with 6 additions and 1 deletions
|
@ -97,7 +97,12 @@ def processTorrent(inputDirectory, inputName, inputCategory, inputHash, inputID,
|
|||
if clientAgent != 'manual':
|
||||
core.pause_torrent(clientAgent, inputHash, inputID, inputName)
|
||||
|
||||
if uniquePath:
|
||||
# Incase input is not directory, make sure to create one.
|
||||
# This way Processing is isolated.
|
||||
if not os.path.isdir(os.path.join(inputDirectory, inputName)):
|
||||
basename = os.path.splitext(core.sanitizeName(inputName))[0]
|
||||
outputDestination = os.path.join(core.OUTPUTDIRECTORY, inputCategory, basename)
|
||||
elif uniquePath:
|
||||
outputDestination = os.path.normpath(
|
||||
core.os.path.join(core.OUTPUTDIRECTORY, inputCategory, core.sanitizeName(inputName)))
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue