From b007a66a3076617787b155bb68191ea4a7406809 Mon Sep 17 00:00:00 2001 From: Clinton Hall Date: Wed, 13 Mar 2013 16:23:55 -0700 Subject: [PATCH] remove directory walk --- autoProcessTV.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/autoProcessTV.py b/autoProcessTV.py index a18a73e6..328f1263 100644 --- a/autoProcessTV.py +++ b/autoProcessTV.py @@ -136,16 +136,12 @@ def processEpisode(dirName, nzbName=None, failed=False): Logger.info("The download failed. Nothing to process") return 0 # Success (as far as this script is concerned) - if status == 0: # only transcode successful downlaods - if transcode == 1: - Logger.info("Checking for files to be transcoded") - mediaContainer = (config.get("Extensions", "mediaExtensions")).split(',') - for dirpath, dirnames, filenames in os.walk(dirName): - for file in filenames: - filePath = os.path.join(dirpath, file) - fileExtension = os.path.splitext(file)[1] - if fileExtension in mediaContainer: # If the file is a video file - result = Transcoder.Transcode_file(filePath) + if status == 0 and transcode == 1: # only transcode successful downlaods + result = Transcoder.Transcode_directory(dirName) + if result == 0: + Logger.debug("Transcoding succeeded for files in %s", dirName) + else: + Logger.warning("Transcoding failed for files in %s", dirName) myOpener = AuthURLOpener(username, password)