fixed some errors getting encoding files
This commit is contained in:
@@ -21,8 +21,10 @@ def ShowHelp():
|
|||||||
print 'TVEncoder.py -e - encode the files that have been processed'
|
print 'TVEncoder.py -e - encode the files that have been processed'
|
||||||
print 'TVEncoder.py -e -l - list the files that would be encoded'
|
print 'TVEncoder.py -e -l - list the files that would be encoded'
|
||||||
|
|
||||||
def PrintShowsToEncode(showData):
|
def PrintShowsToEncode(showsData):
|
||||||
print "/n".join(showData)
|
# print "/n".join(showData)
|
||||||
|
for showData in showsData:
|
||||||
|
print showData.ToString()
|
||||||
|
|
||||||
def PrintShowsToPrepare(showsData):
|
def PrintShowsToPrepare(showsData):
|
||||||
for showData in showsData:
|
for showData in showsData:
|
||||||
@@ -95,4 +97,4 @@ def main(argv):
|
|||||||
tvData.PrepareEpisodes(shows)
|
tvData.PrepareEpisodes(shows)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main(sys.argv[1:])
|
main(sys.argv[1:])
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class EncodeData:
|
|||||||
outputFile = ''
|
outputFile = ''
|
||||||
|
|
||||||
def ToString(self):
|
def ToString(self):
|
||||||
return "Input: {0}/tOutput: {2}".format(self.inputFile, self.outputFile)
|
return "Show: {0}\nInput: {1}\nOutput: {2}\n".format(self.show, self.inputFile, self.outputFile)
|
||||||
|
|
||||||
class FileManager:
|
class FileManager:
|
||||||
def __init__(self, settings):
|
def __init__(self, settings):
|
||||||
@@ -29,7 +29,7 @@ class FileManager:
|
|||||||
fileList = []
|
fileList = []
|
||||||
|
|
||||||
for show in self.settings.GetShowNames():
|
for show in self.settings.GetShowNames():
|
||||||
for r,d,f in os.walk(show.GetShowInputDirectory(show)):
|
for r,d,f in os.walk(self.settings.GetShowInputDirectory(show)):
|
||||||
for files in f:
|
for files in f:
|
||||||
if files.endswith(".mpg"):
|
if files.endswith(".mpg"):
|
||||||
data = EncodeData()
|
data = EncodeData()
|
||||||
@@ -52,13 +52,13 @@ class FileManager:
|
|||||||
def __GetEncodeOutputFile(self, inputFile, showName, readOnly):
|
def __GetEncodeOutputFile(self, inputFile, showName, readOnly):
|
||||||
inFile = os.path.basename(inputFile)
|
inFile = os.path.basename(inputFile)
|
||||||
outFilename = inFile[:-3]+"mkv"
|
outFilename = inFile[:-3]+"mkv"
|
||||||
outPath = self.__FindSeason(self.settings.GetShowOutputFile(showName), outFilename)
|
outPath = self.__FindSeason(self.settings.GetShowOutputDirectory(showName), outFilename, readOnly)
|
||||||
return os.path.join(outPath, outFilename)
|
return os.path.join(outPath, outFilename)
|
||||||
|
|
||||||
def GetEncodingFiles(self, readOnly=True):
|
def GetEncodingFiles(self, readOnly=True):
|
||||||
showsData = self.__GetInputFilesToEncode(self.settings.GetShowNames())
|
showsData = self.__GetInputFilesToEncode()
|
||||||
for showData in showsData:
|
for showData in showsData:
|
||||||
showData.outputFile = self.__GetEncodeOutputFile(showData.inputFile, showData.name, readOnly)
|
showData.outputFile = self.__GetEncodeOutputFile(showData.inputFile, showData.show, readOnly)
|
||||||
|
|
||||||
return showsData
|
return showsData
|
||||||
|
|
||||||
@@ -102,4 +102,4 @@ class FileManager:
|
|||||||
return showsToProcess
|
return showsToProcess
|
||||||
|
|
||||||
return showsToProcess #will reach here if there were less than numberofFiles found
|
return showsToProcess #will reach here if there were less than numberofFiles found
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user