bug fixing

This commit is contained in:
2013-07-08 17:40:55 +10:00
parent 7a34fd01c8
commit 6e2aff7ab8
3 changed files with 22 additions and 7 deletions

View File

@@ -64,6 +64,13 @@ class Settings:
else:
return show["InputDirectory"]
def GetShowUnknownDirectory(self, showName):
show = self.__GetShowSubsection(showName)
if show is None:
return ""
else:
return show["UnknownDirectory"]
def GetShowOutputDirectory(self, showName):
show = self.__GetShowSubsection(showName)
if show is None:

View File

@@ -30,13 +30,15 @@ class TVData:
else:
return number
def GetDirectory(self, title, season):
def GetDirectory(self, title, seasonFolder, season, episode):
show = self.settings.GetShow(title)
if not show or show == "":
print "Couldn't find show for {0}".format(title)
return self.settings.UnknownDirectory()
elif season == "S00" or episode == "E00":
return self.settings.GetShowUnknownDirectory(show)
else:
return os.path.join(self.settings.GetShowInputDirectory(show), season)
return os.path.join(self.settings.GetShowInputDirectory(show), seasonFolder)
#==============================================================================
# if title == "Thomas and Friends" or title == "Thomas the Tank Engine & Friends":
# directory = THOMAS
@@ -80,7 +82,7 @@ class TVData:
show.episode = str(result[1])
show.subtitle = result[2]
if show.season != "0" and show.episode != "0":
#if show.season != "0" and show.episode != "0":
show.season = self.FixEpisodeSeasonNumber(show.season)
show.episode = self.FixEpisodeSeasonNumber(show.episode)
@@ -89,7 +91,7 @@ class TVData:
episode = "E{0}".format(show.episode)
renamedFile = "{0}{1} - {2} - SD TV_.mpg".format(season, episode, show.subtitle)
directory = self.GetDirectory(show.title, seasonFolder)
directory = self.GetDirectory(show.title, seasonFolder, season, episode)
show.outputFile = os.path.join(directory, file[:-4], renamedFile)
show.inputFile = inputFile

View File

@@ -16,36 +16,42 @@ HandbrakeCommand = "HandBrakeCLI", "--verbose", "-i", "SUBSTITUTE WITH INPUT FIL
UnknownInput = "/srv/storage2/files/VideoProcessing/Unknown/"
[[ "Thomas the Tank Engine & Friends" ]]
InputDirectory = "/srv/storage2/files/VideoProcessing/Thomas/Input/"
UnknownDirectory = "/srv/storage2/files/VideoProcessing/Unknown/Thomas/"
OutputDirectory = "/srv/storage2/videos/Kids/TV/Thomas The Tank Engine & Friends/"
alias = "Thomas and Friends",
MythTvEpisodePrefix = ,
SickbeardPrefix = ""
[[ "Chuggington" ]]
InputDirectory = "/srv/storage2/files/VideoProcessing/Chuggington/Input/"
UnknownDirectory = "/srv/storage2/files/VideoProcessing/Unknown/Chuggington/"
OutputDirectory = "/srv/storage2/videos/Kids/TV/Chuggington/"
alias = ,
MythTvEpisodePrefix = ,
SickbeardPrefix = ""
[[ "Mike the Knight" ]]
InputDirectory = "/srv/storage2/files/VideoProcessing/MikeTheKnight/Input/"
UnknownDirectory = "/srv/storage2/files/VideoProcessing/Unknown/MikeTheKnight/"
OutputDirectory = "/srv/storage2/videos/Kids/TV/Mike the Knight/"
alias = ,
MythTvEpisodePrefix = "Mike the Knight and the ", Mike the Knight and "
SickbeardPrefix = ""
[[ "Octonauts" ]]
InputDirectory = "/srv/storage2/files/VideoProcessing/Octonauts/Input/"
UnknownDirectory = "/srv/storage2/files/VideoProcessing/Unknown/Octonauts/"
OutputDirectory = "/srv/storage2/videos/Kids/TV/Octonauts/"
alias = "The Octonauts",
MythTvEpisodePrefix = "The Octonauts and ",
SickbeardPrefix = "The "
SickbeardPrefix = "The"
[[ "In the Night Garden" ]]
InputDirectory = "/srv/storage2/files/VideoProcessing/InTheNightGarden/Input/"
UnknownDirectory = "/srv/storage2/files/VideoProcessing/Unknown/InTheNightGarden/"
OutputDirectory = "/srv/storage2/videos/Kids/TV/In The Night Garden/"
alias = ,
MythTvEpisodePrefix = ,
SickbeardPrefix = ""
[[ "Raa Raa! The Noisy Lion" ]]
InputDirectory = "/srv/storage2/files/VideoProcessing/RaaRaa/Input/"
UnknownDirectory = "/srv/storage2/files/VideoProcessing/Unknown/RaaRaa/"
OutputDirectory = "/srv/storage2/videos/Kids/TV/Raa Raa the Noisy Lion/"
alias = ,
MythTvEpisodePrefix = ,