move error fixing
This commit is contained in:
15
TVEncoder.py
15
TVEncoder.py
@@ -12,8 +12,8 @@ from libsettings import Settings
|
|||||||
from libhandbrake import Encoder
|
from libhandbrake import Encoder
|
||||||
import libtvdatasource
|
import libtvdatasource
|
||||||
|
|
||||||
#TVRECORDINGSDIR = "/Volumes/TV Recordings/"
|
TVRECORDINGSDIR = "/Volumes/TV Recordings/"
|
||||||
TVRECORDINGSDIR = "/srv/storage2/videos/TVRecordings/" # TODO move this to settings
|
#TVRECORDINGSDIR = "/srv/storage2/videos/TVRecordings/" # TODO move this to settings
|
||||||
|
|
||||||
def ShowHelp():
|
def ShowHelp():
|
||||||
print 'TVEncoder.py -p -n <number of files to prepare for processing> - prepare n recordings'
|
print 'TVEncoder.py -p -n <number of files to prepare for processing> - prepare n recordings'
|
||||||
@@ -24,8 +24,9 @@ def ShowHelp():
|
|||||||
def PrintShowsToEncode(showData):
|
def PrintShowsToEncode(showData):
|
||||||
print "/n".join(showData)
|
print "/n".join(showData)
|
||||||
|
|
||||||
def PrintShowsToPrepare(showData):
|
def PrintShowsToPrepare(showsData):
|
||||||
print "/n".join(showData)
|
for showData in showsData:
|
||||||
|
showData.Print()
|
||||||
|
|
||||||
def main(argv):
|
def main(argv):
|
||||||
numFiles = 0
|
numFiles = 0
|
||||||
@@ -63,7 +64,11 @@ def main(argv):
|
|||||||
PrintShowsToEncode(showData)
|
PrintShowsToEncode(showData)
|
||||||
else:
|
else:
|
||||||
# Generate the list of files to process
|
# 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))
|
print "num results: {0}".format(len(shows))
|
||||||
PrintShowsToPrepare(shows)
|
PrintShowsToPrepare(shows)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ def GetFilesToPrepare(path, numberofFiles, shows):
|
|||||||
if showData:
|
if showData:
|
||||||
showsToProcess.append(showData)
|
showsToProcess.append(showData)
|
||||||
i = i + 1
|
i = i + 1
|
||||||
if i == numberofFiles:
|
if i == int(numberofFiles):
|
||||||
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
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ def RetrieveEpisodeData(serverAddress, user, password, database, inputFile):
|
|||||||
cur = con.cursor(mdb.cursors.DictCursor)
|
cur = con.cursor(mdb.cursors.DictCursor)
|
||||||
cur.execute("select episode, season, title, subtitle, description from mythconverg.recorded where basename = '{0}'".format(inputFile))
|
cur.execute("select episode, season, title, subtitle, description from mythconverg.recorded where basename = '{0}'".format(inputFile))
|
||||||
result = cur.fetchone()
|
result = cur.fetchone()
|
||||||
print result
|
#print result
|
||||||
|
|
||||||
return TVShow(result['episode'], result['season'], result['title'], result['subtitle'], result['description'])
|
return TVShow(result['episode'], result['season'], result['title'], result['subtitle'], result['description'])
|
||||||
|
|
||||||
@@ -47,9 +47,9 @@ def GetDirectory(title, season):
|
|||||||
|
|
||||||
def RetrieveEpisodeData(serverAddress, user, password, database, inputFile, showsToProcess, sickbeardAddress, sickbeardPort, sickbeardAPIKey):
|
def RetrieveEpisodeData(serverAddress, user, password, database, inputFile, showsToProcess, sickbeardAddress, sickbeardPort, sickbeardAPIKey):
|
||||||
file = os.path.basename(inputFile)
|
file = os.path.basename(inputFile)
|
||||||
print file
|
#print file
|
||||||
show = MythTV.RetrieveEpisodeData(serverAddress, user, password, database, 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.title and show.title in showsToProcess:
|
||||||
if show.subtitle:
|
if show.subtitle:
|
||||||
|
|||||||
@@ -14,3 +14,6 @@ class TVShow:
|
|||||||
self.description = description
|
self.description = description
|
||||||
self.inputFile = inputFile
|
self.inputFile = inputFile
|
||||||
self.outputFile = outputFile
|
self.outputFile = outputFile
|
||||||
|
|
||||||
|
def Print(self):
|
||||||
|
print "Input: {0} -> Output: {1}".format(self.inputFile, self.outputFile)
|
||||||
Reference in New Issue
Block a user