fixing errors
This commit is contained in:
16
TVEncoder.py
16
TVEncoder.py
@@ -9,7 +9,7 @@ import sys
|
||||
import getopt
|
||||
import libfilemanager
|
||||
from libsettings import Settings
|
||||
import libhandbrake
|
||||
from libhandbrake import Encoder
|
||||
import libtvdatasource
|
||||
|
||||
TVRECORDINGSDIR = "/srv/storage2/videos/TVRecordings/" # TODO move this to settings
|
||||
@@ -58,28 +58,28 @@ def main(argv):
|
||||
if readOnly and doList:
|
||||
if doEncode:
|
||||
#Generate the list of files that would be encoded
|
||||
showData = GetEncodingFiles(shows, readOnly)
|
||||
showData = libfilemanager.GetEncodingFiles(shows, readOnly)
|
||||
PrintShowsToEncode(showData)
|
||||
else:
|
||||
# Generate the list of files to process
|
||||
shows = GetFilesToPrepare(TVRECORDINGSDIR, numFiles, shows)
|
||||
shows = libfilemanager.GetFilesToPrepare(TVRECORDINGSDIR, numFiles, shows)
|
||||
PrintShowsToPrepare(shows)
|
||||
else:
|
||||
if doEncode:
|
||||
#Encode the files and move them to their final destination
|
||||
showData = GetEncodingFiles(shows, readOnly)
|
||||
showData = libfilemanager.GetEncodingFiles(shows, readOnly)
|
||||
|
||||
for show in showData:
|
||||
if CheckFileExists(show.outputFile):
|
||||
if libfilemanager.CheckFileExists(show.outputFile):
|
||||
print "File {0} already exists. Cannot process.".format(show.outputFile)
|
||||
else:
|
||||
result = Encoder.Encode(show.inputFile, show.outputFile)
|
||||
|
||||
PerformPostEncodeFileOperations(show.inputFile, show.outputFile)
|
||||
libfilemanager.PerformPostEncodeFileOperations(show.inputFile, show.outputFile)
|
||||
else:
|
||||
# TODO Process files for encoding
|
||||
shows = GetFilesToPrepare(TVRECORDINGSDIR, numFiles, shows)
|
||||
PrepareEpisodes(shows)
|
||||
shows = libfilemanager.GetFilesToPrepare(TVRECORDINGSDIR, numFiles, shows)
|
||||
libtvdatasource.PrepareEpisodes(shows)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main(sys.argv[1:])
|
||||
@@ -6,7 +6,7 @@ Created on Fri Jul 5 14:10:47 2013
|
||||
"""
|
||||
|
||||
import MySQLdb as mdb
|
||||
from libtvdatasource import TVShow
|
||||
from libtvshow import TVShow
|
||||
|
||||
class MythTV:
|
||||
def RetrieveEpisodeData(serverAddress, user, password, database, inputFile):
|
||||
|
||||
@@ -5,7 +5,7 @@ Created on Fri Jul 5 14:10:37 2013
|
||||
@author: shanef
|
||||
"""
|
||||
|
||||
from libtvdatasource import TVShow
|
||||
from libtvshow import TVShow
|
||||
import json
|
||||
from urllib import urlopen
|
||||
from fuzzywuzzy import fuzz
|
||||
|
||||
@@ -9,6 +9,7 @@ import libmythtv as MythTV
|
||||
from libsickbeard import Sickbeard
|
||||
import os
|
||||
import shutil
|
||||
from libtvshow import TVShow
|
||||
|
||||
# TODO Move these to settings
|
||||
PROCESSDIR="/srv/storage2/files/VideoProcessing/"
|
||||
@@ -20,16 +21,6 @@ NIGHTGARDEN="InTheNightGarden"
|
||||
RAARAA="RaaRaa"
|
||||
INPUTDIR="Input"
|
||||
|
||||
class TVShow:
|
||||
def __init__(self, episode, season, title, subtitle, description, inputFile='', outputFile=''):
|
||||
self.episode = episode
|
||||
self.season = season
|
||||
self.title = title
|
||||
self.subtitle = subtitle
|
||||
self.description = description
|
||||
self.inputFile = inputFile
|
||||
self.outputFile = outputFile
|
||||
|
||||
def FixEpisodeSeasonNumber(number):
|
||||
if number < 10:
|
||||
return "0{0}".format(number)
|
||||
|
||||
16
libtvshow.py
Normal file
16
libtvshow.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Created on Sat Jul 6 20:26:22 2013
|
||||
|
||||
@author: shanef
|
||||
"""
|
||||
|
||||
class TVShow:
|
||||
def __init__(self, episode, season, title, subtitle, description, inputFile='', outputFile=''):
|
||||
self.episode = episode
|
||||
self.season = season
|
||||
self.title = title
|
||||
self.subtitle = subtitle
|
||||
self.description = description
|
||||
self.inputFile = inputFile
|
||||
self.outputFile = outputFile
|
||||
Reference in New Issue
Block a user