single file torrent sub directory name changed. fixes #176

This commit is contained in:
clinton-hall 2013-09-10 08:42:54 +09:30
commit ea80cbaf24
3 changed files with 12 additions and 2 deletions

View file

@ -40,8 +40,13 @@ def main(inputDirectory, inputName, inputCategory, inputHash, inputID):
for category in categories:
if category == inputCategory:
outputDestination = os.path.normpath(os.path.join(outputDirectory, category, safeName(inputName)))
Logger.info("MAIN: Output directory set to: %s", outputDestination)
if os.path.basename(inputDirectory) == inputName:
Logger.info("MAIN: Download is a directory")
outputDestination = os.path.normpath(os.path.join(outputDirectory, category, safeName(inputName)))
else:
Logger.info("MAIN: Download is not a directory")
outputDestination = os.path.normpath(os.path.join(outputDirectory, category, os.path.splitext(safeName(inputName))[0]))
Logger.info("MAIN: Output directory set to: %s", outputDestination)
break
else:
continue