Cleaned up code and fixed a few small bugs.

This commit is contained in:
echel0n 2014-04-24 21:23:10 -07:00
commit 289d451112
11 changed files with 274 additions and 286 deletions

View file

@ -7,23 +7,6 @@ from nzbtomedia.nzbToMediaUtil import get_downloadInfo
# Initialize the config
nzbtomedia.initialize()
inputDirectory = 'Z:/complete/music/B.O.A.T.S. II_ Me Time [2013]'
outputDestination = 'Z:\\test\\music\\B.O.A.T.S. II_ Me Time [2013]'
outputDestinationMaster = outputDestination # Save the original, so we can change this within the loop below, and reset afterwards.
now = datetime.datetime.now()
for dirpath, dirnames, filenames in os.walk(inputDirectory):
for file in filenames:
filePath = os.path.join(dirpath, file)
fileName, fileExtension = os.path.splitext(file)
newDir = dirpath # find the full path
newDir = newDir.replace(inputDirectory, "") #find the extra-depth directory
if len(newDir) > 0 and newDir[0] == "/":
newDir = newDir[1:] # remove leading "/" to enable join to work.
outputDestination = os.path.join(outputDestinationMaster, newDir) # join this extra directory to output.
targetDirectory = os.path.join(outputDestination, file)
outputDestination = outputDestinationMaster
nzbtomedia.flatten(outputDestination)
test = nzbtomedia.CFG['HeadPhones']['music']
section = nzbtomedia.CFG.findsection('tv').isenabled()
print section