From 7e94c46ae770ec720b072c0dde811491b5aff50e Mon Sep 17 00:00:00 2001 From: clinton-hall Date: Fri, 14 Feb 2014 15:03:29 +1030 Subject: [PATCH] one more directory check. #262 --- TorrentToMedia.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TorrentToMedia.py b/TorrentToMedia.py index a4cf7a36..ef3f7642 100755 --- a/TorrentToMedia.py +++ b/TorrentToMedia.py @@ -51,7 +51,7 @@ def main(inputDirectory, inputName, inputCategory, inputHash, inputID): outputDestination = "" for category in categories: if category == inputCategory: - if os.path.basename(inputDirectory) == inputName: + if os.path.basename(inputDirectory) == inputName and os.path.isdir(inputDirectory): Logger.info("MAIN: Download is a directory") outputDestination = os.path.normpath(os.path.join(outputDirectory, category, safeName(inputName))) else: @@ -64,7 +64,7 @@ def main(inputDirectory, inputName, inputCategory, inputHash, inputID): if outputDestination == "": if inputCategory == "": inputCategory = "UNCAT" - if os.path.basename(inputDirectory) == inputName: + if os.path.basename(inputDirectory) == inputName and os.path.isdir(inputDirectory): Logger.info("MAIN: Download is a directory") outputDestination = os.path.normpath(os.path.join(outputDirectory, inputCategory, safeName(inputName))) else: