mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-22 06:13:19 -07:00
remove directory walk
This commit is contained in:
parent
cfa68b8a3c
commit
b007a66a30
1 changed files with 6 additions and 10 deletions
|
@ -136,16 +136,12 @@ def processEpisode(dirName, nzbName=None, failed=False):
|
||||||
Logger.info("The download failed. Nothing to process")
|
Logger.info("The download failed. Nothing to process")
|
||||||
return 0 # Success (as far as this script is concerned)
|
return 0 # Success (as far as this script is concerned)
|
||||||
|
|
||||||
if status == 0: # only transcode successful downlaods
|
if status == 0 and transcode == 1: # only transcode successful downlaods
|
||||||
if transcode == 1:
|
result = Transcoder.Transcode_directory(dirName)
|
||||||
Logger.info("Checking for files to be transcoded")
|
if result == 0:
|
||||||
mediaContainer = (config.get("Extensions", "mediaExtensions")).split(',')
|
Logger.debug("Transcoding succeeded for files in %s", dirName)
|
||||||
for dirpath, dirnames, filenames in os.walk(dirName):
|
else:
|
||||||
for file in filenames:
|
Logger.warning("Transcoding failed for files in %s", dirName)
|
||||||
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)
|
|
||||||
|
|
||||||
myOpener = AuthURLOpener(username, password)
|
myOpener = AuthURLOpener(username, password)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue