move error fixing

This commit is contained in:
2013-07-06 21:59:33 +10:00
parent 4a5cc6d0c6
commit a10bed2ddb
5 changed files with 18 additions and 10 deletions

View File

@@ -12,8 +12,8 @@ from libsettings import Settings
from libhandbrake import Encoder
import libtvdatasource
#TVRECORDINGSDIR = "/Volumes/TV Recordings/"
TVRECORDINGSDIR = "/srv/storage2/videos/TVRecordings/" # TODO move this to settings
TVRECORDINGSDIR = "/Volumes/TV Recordings/"
#TVRECORDINGSDIR = "/srv/storage2/videos/TVRecordings/" # TODO move this to settings
def ShowHelp():
print 'TVEncoder.py -p -n <number of files to prepare for processing> - prepare n recordings'
@@ -24,8 +24,9 @@ def ShowHelp():
def PrintShowsToEncode(showData):
print "/n".join(showData)
def PrintShowsToPrepare(showData):
print "/n".join(showData)
def PrintShowsToPrepare(showsData):
for showData in showsData:
showData.Print()
def main(argv):
numFiles = 0
@@ -63,7 +64,11 @@ def main(argv):
PrintShowsToEncode(showData)
else:
# Generate the list of files to process
shows = libfilemanager.GetFilesToPrepare(TVRECORDINGSDIR, numFiles, showSettings)
tempShowList = ["Thomas and Friends", "Thomas the Tank Engine & Friends",
"Chuggington", "Mike the Knight", "Octonauts",
"The Octonauts", "In the Night Garden",
"Raa Raa! The Noisy Lion"] # TODO get from settings
shows = libfilemanager.GetFilesToPrepare(TVRECORDINGSDIR, numFiles, tempShowList)
print "num results: {0}".format(len(shows))
PrintShowsToPrepare(shows)
else:

View File

@@ -93,7 +93,7 @@ def GetFilesToPrepare(path, numberofFiles, shows):
if showData:
showsToProcess.append(showData)
i = i + 1
if i == numberofFiles:
if i == int(numberofFiles):
return showsToProcess
return showsToProcess #will reach here if there were less than numberofFiles found

View File

@@ -15,7 +15,7 @@ def RetrieveEpisodeData(serverAddress, user, password, database, inputFile):
cur = con.cursor(mdb.cursors.DictCursor)
cur.execute("select episode, season, title, subtitle, description from mythconverg.recorded where basename = '{0}'".format(inputFile))
result = cur.fetchone()
print result
#print result
return TVShow(result['episode'], result['season'], result['title'], result['subtitle'], result['description'])

View File

@@ -47,9 +47,9 @@ def GetDirectory(title, season):
def RetrieveEpisodeData(serverAddress, user, password, database, inputFile, showsToProcess, sickbeardAddress, sickbeardPort, sickbeardAPIKey):
file = os.path.basename(inputFile)
print file
#print file
show = MythTV.RetrieveEpisodeData(serverAddress, user, password, database, file)
print "file: {0} mythtv returned show name {1}".format(file, show.title)
#print "file: {0} mythtv returned show name {1}".format(file, show.title)
if show.title and show.title in showsToProcess:
if show.subtitle:

View File

@@ -13,4 +13,7 @@ class TVShow:
self.subtitle = subtitle
self.description = description
self.inputFile = inputFile
self.outputFile = outputFile
self.outputFile = outputFile
def Print(self):
print "Input: {0} -> Output: {1}".format(self.inputFile, self.outputFile)