added check for single file Torrent. Fixes #924

This commit is contained in:
clinton-hall 2018-04-12 21:31:59 +12:00
parent 23fa424238
commit b5ee0c241c

View file

@ -142,7 +142,11 @@ def processTorrent(inputDirectory, inputName, inputCategory, inputHash, inputID,
inputFiles = core.listMediaFiles(inputDirectory, archives=False, other=True, otherext=extensions)
else:
inputFiles = core.listMediaFiles(inputDirectory, other=True, otherext=extensions)
logger.debug("Found {0} files in {1}".format(len(inputFiles), inputDirectory))
if len(inputFiles) == 0 and os.path.isfile(inputDirectory):
inputFiles = [inputDirectory]
logger.debug("Found 1 file to process: {0}".format(inputDirectory))
else:
logger.debug("Found {0} files in {1}".format(len(inputFiles), inputDirectory))
for inputFile in inputFiles:
filePath = os.path.dirname(inputFile)
fileName, fileExt = os.path.splitext(os.path.basename(inputFile))