bug fixing

This commit is contained in:
2013-07-09 21:23:07 +10:00
parent de54bfb876
commit 1148dce0ab
3 changed files with 13 additions and 3 deletions

View File

@@ -50,6 +50,14 @@ class Sickbeard:
return None return None
def FindEpisodeName(self, showId, season, episode):
jsonurl = urlopen("{0}?cmd=episode&tvdbid={1}&season={2}&episode={3}".format(self.__GetApiURL(), showId, int(season), int(episode)))
result = json.loads(jsonurl.read())
if result['result'] == 'error':
return ""
else:
return result['data']['name']
def FindEpisode(self, showId, name=None, description=None): def FindEpisode(self, showId, name=None, description=None):
jsonurl = urlopen("{0}?cmd=show.seasons&tvdbid={1}".format(self.__GetApiURL(), showId)) jsonurl = urlopen("{0}?cmd=show.seasons&tvdbid={1}".format(self.__GetApiURL(), showId))
result = json.loads(jsonurl.read()) result = json.loads(jsonurl.read())

View File

@@ -82,6 +82,9 @@ class TVData:
show.episode = str(result[1]) show.episode = str(result[1])
show.subtitle = result[2] show.subtitle = result[2]
if show.subtitle is None or show.subtitle == "":
show.subtitle = sickbeard.FindEpisodeName(showId, show.season, show.episode)
#if show.season != "0" and show.episode != "0": #if show.season != "0" and show.episode != "0":
show.season = self.FixEpisodeSeasonNumber(show.season) show.season = self.FixEpisodeSeasonNumber(show.season)
show.episode = self.FixEpisodeSeasonNumber(show.episode) show.episode = self.FixEpisodeSeasonNumber(show.episode)

View File

@@ -4,4 +4,3 @@ Created on Fri Jul 5 14:12:38 2013
@author: shanef @author: shanef
""" """