From 7accf74fb960ddb92d4bdbdfa306d99977fe7d52 Mon Sep 17 00:00:00 2001 From: Clinton Hall Date: Mon, 4 Mar 2013 16:21:18 -0800 Subject: [PATCH] added safeName for windows directory --- TorrentToMedia.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/TorrentToMedia.py b/TorrentToMedia.py index 73faab5f..e998b150 100755 --- a/TorrentToMedia.py +++ b/TorrentToMedia.py @@ -29,10 +29,10 @@ def main(inputDirectory, inputName, inputCategory, inputHash): Logger.debug("MAIN: Received Directory: %s | Name: %s | Category: %s", inputDirectory, inputName, inputCategory) inputDirectory, inputName, inputCategory, root = category_search(inputDirectory, inputName, inputCategory, root, categories) # Confirm the category by parsing directory structure - + for category in categories: if category == inputCategory: - outputDestination = os.path.normpath(os.path.join(outputDirectory, category, inputName)) + outputDestination = os.path.normpath(os.path.join(outputDirectory, category, safeName(inputName))) Logger.info("MAIN: Output directory set to: %s", outputDestination) break else: @@ -50,7 +50,7 @@ def main(inputDirectory, inputName, inputCategory, inputHash): if root == 1: Logger.debug("MAIN: Looking for %s in filename", inputName) - if (inputName in file) or (os.path.splitext(file)[0] in inputName): + if (safeName(inputName) in safeName(file)) or (safeName(os.path.splitext(file)[0]) in safeName(inputName)): pass # This file does match the Torrent name Logger.debug("Found file %s that matches Torrent Name %s", file, inputName) else: