mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-19 21:03:14 -07:00
TorrentToMedia: fix invalid indexing scope, select first elem of pair not char
Fix for issue manifesting itself with the following exception: Traceback (most recent call last): File "/opt/nzbToMedia/TorrentToMedia.py", line 366, in <module> exit(main(sys.argv)) File "/opt/nzbToMedia/TorrentToMedia.py", line 303, in main result = processTorrent(inputDirectory, inputName, inputCategory, inputHash, inputID, clientAgent) File "/opt/nzbToMedia/TorrentToMedia.py", line 118, in processTorrent outputDestination = os.path.join(core.OUTPUTDIRECTORY, inputCategory, basename) File "/usr/local/lib/python2.7/posixpath.py", line 68, in join if b.startswith('/'): AttributeError: 'tuple' object has no attribute 'startswith' The indexing operator was applied to wrong object: should be selecting first element of tuple returned by splitext() instead of first char of string passed to splitext.
This commit is contained in:
parent
ef8701ed59
commit
d500c61b95
1 changed files with 1 additions and 1 deletions
|
@ -114,7 +114,7 @@ def processTorrent(inputDirectory, inputName, inputCategory, inputHash, inputID,
|
|||
if not os.path.isdir(os.path.join(inputDirectory, inputName)):
|
||||
basename = os.path.basename(inputDirectory)
|
||||
basename = core.sanitizeName(inputName) \
|
||||
if inputName == basename else os.path.splitext(core.sanitizeName(inputName)[0])
|
||||
if inputName == basename else os.path.splitext(core.sanitizeName(inputName))[0]
|
||||
outputDestination = os.path.join(core.OUTPUTDIRECTORY, inputCategory, basename)
|
||||
elif uniquePath:
|
||||
outputDestination = os.path.normpath(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue