diff --git a/SickBeard.py b/SickBeard.py index 947ed781..49328f62 100755 --- a/SickBeard.py +++ b/SickBeard.py @@ -414,6 +414,7 @@ class SickRage(object): for sqlShow in sqlResults: try: curShow = TVShow(int(sqlShow["indexer"]), int(sqlShow["indexer_id"])) + curShow.nextEpisode() sickbeard.showList.append(curShow) except Exception, e: logger.log( diff --git a/gui/slick/interfaces/default/home.tmpl b/gui/slick/interfaces/default/home.tmpl index 17120fdb..40370402 100644 --- a/gui/slick/interfaces/default/home.tmpl +++ b/gui/slick/interfaces/default/home.tmpl @@ -214,7 +214,6 @@ $myShowList.sort(lambda x, y: cmp(x.name, y.name)) #for $curShow in $myShowList: -#set $nextAirdate = $curShow.nextEpisode() #set $curShowDownloads = [x[1] for x in $downloadedEps if int(x[0]) == $curShow.indexerid] #set $curShowAll = [x[1] for x in $allEps if int(x[0]) == $curShow.indexerid] @@ -237,8 +236,8 @@ $myShowList.sort(lambda x, y: cmp(x.name, y.name)) #set $which_thumb = $layout+"_thumb" - #if $nextAirdate: - #set $ldatetime = $network_timezones.parse_date_time($nextAirdate,$curShow.airs,$curShow.network) + #if $curShow.nextaired: + #set $ldatetime = $network_timezones.parse_date_time($curShow.nextaired,$curShow.airs,$curShow.network)
$sbdatetime.sbdatetime.sbfdate($ldatetime)
$time.mktime($ldatetime.timetuple()) #else: diff --git a/gui/slick/interfaces/default/manage.tmpl b/gui/slick/interfaces/default/manage.tmpl index 1138d997..71e3ae2c 100644 --- a/gui/slick/interfaces/default/manage.tmpl +++ b/gui/slick/interfaces/default/manage.tmpl @@ -111,7 +111,7 @@ #set $myShowList = $sickbeard.showList $myShowList.sort(lambda x, y: cmp(x.name, y.name)) #for $curShow in $myShowList: -#set $curEp = $curShow.nextEpisode() +#set $curEp = $curShow.nextaired #set $curUpdate_disabled = "" #set $curRefresh_disabled = "" #set $curRename_disabled = "" diff --git a/sickbeard/showUpdater.py b/sickbeard/showUpdater.py index 46c0734c..2789c617 100644 --- a/sickbeard/showUpdater.py +++ b/sickbeard/showUpdater.py @@ -93,6 +93,9 @@ class ShowUpdater(): for curShow in sickbeard.showList: try: + # get next episode airdate + curShow.nextEpisode() + # if should_update returns True (not 'Ended') or show is selected stale 'Ended' then update, otherwise just refresh if curShow.should_update(update_date=update_date) or curShow.indexerid in stale_should_update: curQueueItem = sickbeard.showQueueScheduler.action.updateShow(curShow, True) # @UndefinedVariable diff --git a/sickbeard/tv.py b/sickbeard/tv.py index 8b3e483f..249ddbbd 100644 --- a/sickbeard/tv.py +++ b/sickbeard/tv.py @@ -988,7 +988,7 @@ class TVShow(object): if sqlResults == None or len(sqlResults) == 0: logger.log(str(self.indexerid) + u": No episode found... need to implement a show status", logger.DEBUG) - self.nextaired = curDate + self.nextaired = None else: logger.log(str(self.indexerid) + u": Found episode " + str(sqlResults[0]["season"]) + "x" + str( sqlResults[0]["episode"]), logger.DEBUG) diff --git a/sickbeard/webapi.py b/sickbeard/webapi.py index 35dd695e..341033bf 100644 --- a/sickbeard/webapi.py +++ b/sickbeard/webapi.py @@ -1758,7 +1758,7 @@ class CMD_Show(ApiCall): showDict["network"] = "" showDict["status"] = showObj.status - nextAirdate = showObj.nextEpisode() + nextAirdate = showObj.nextaired if nextAirdate: nextAirdate = _ordinal_to_dateForm(nextAirdate) else: @@ -2502,7 +2502,7 @@ class CMD_Shows(ApiCall): """ display_is_int_multi( self.indexerid )shows in sickbeard """ shows = {} for curShow in sickbeard.showList: - nextAirdate = curShow.nextEpisode() + nextAirdate = curShow.nextaired if nextAirdate: nextAirdate = _ordinal_to_dateForm(nextAirdate) else: