From faeb11a9ac65402d2f654dd18b4b916b338d97f3 Mon Sep 17 00:00:00 2001 From: echel0n Date: Sun, 4 May 2014 22:50:28 -0700 Subject: [PATCH] Fixes issue #376 --- sickbeard/tv.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/sickbeard/tv.py b/sickbeard/tv.py index c894f6be..dfc1978a 100644 --- a/sickbeard/tv.py +++ b/sickbeard/tv.py @@ -199,7 +199,8 @@ class TVShow(object): if file != None: ep = TVEpisode(self, season, episode, file) else: - ep = TVEpisode(self, season, episode, file) + ep = TVEpisode(self, season, episode) + if ep != None: self.episodes[season][episode] = ep @@ -849,10 +850,6 @@ class TVShow(object): logger.log(str(self.indexerid) + u": Obtained info from IMDb ->" + str(self.imdb_info), logger.DEBUG) def nextEpisode(self): - if 'ended' in str(self.status).lower(): - logger.log(str(self.indexerid) + u": Show Status: " + str(self.status) + ", skipping ...", logger.DEBUG) - return [] - logger.log(str(self.indexerid) + ": Finding the episode which airs next", logger.DEBUG) myDB = db.DBConnection() @@ -1132,8 +1129,8 @@ class TVEpisode(object): self._name = "" self._season = season self._episode = episode - self._scene_season = -1 - self._scene_episode = -1 + self._scene_season = season + self._scene_episode = episode self._description = "" self._subtitles = list() self._subtitles_searchcount = 0 @@ -1152,10 +1149,10 @@ class TVEpisode(object): self.show = show - self._indexer = int(self.show.indexer) - self._location = file + self._indexer = int(self.show.indexer) + self.lock = threading.Lock() self.specifyEpisode(self.season, self.episode) @@ -1276,7 +1273,7 @@ class TVEpisode(object): cur_tbn = False # check for nfo and tbn - if self.location and ek.ek(os.path.isfile, self.location): + if ek.ek(os.path.isfile, self.location): for cur_provider in sickbeard.metadata_provider_dict.values(): if cur_provider.episode_metadata: new_result = cur_provider._has_episode_metadata(self) @@ -1300,7 +1297,7 @@ class TVEpisode(object): sqlResult = self.loadFromDB(season, episode) - if not sqlResult and self.location: + if not sqlResult: # only load from NFO if we didn't load from DB if ek.ek(os.path.isfile, self.location): try: