mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-13 03:22:22 -05:00
NextEpisode code modified to return the airdate ordinal instead of a ep object, faster.
This commit is contained in:
parent
58788f52e5
commit
dbe22b570b
@ -214,7 +214,7 @@
|
|||||||
|
|
||||||
$myShowList.sort(lambda x, y: cmp(x.name, y.name))
|
$myShowList.sort(lambda x, y: cmp(x.name, y.name))
|
||||||
#for $curShow in $myShowList:
|
#for $curShow in $myShowList:
|
||||||
#set $curEp = $curShow.nextEpisode()
|
#set $nextAirdate = $curShow.nextEpisode()
|
||||||
|
|
||||||
#set $curShowDownloads = [x[1] for x in $downloadedEps if int(x[0]) == $curShow.indexerid]
|
#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]
|
#set $curShowAll = [x[1] for x in $allEps if int(x[0]) == $curShow.indexerid]
|
||||||
@ -237,8 +237,8 @@ $myShowList.sort(lambda x, y: cmp(x.name, y.name))
|
|||||||
#set $which_thumb = $layout+"_thumb"
|
#set $which_thumb = $layout+"_thumb"
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
#if $curEp:
|
#if $nextAirdate:
|
||||||
#set $ldatetime = $network_timezones.parse_date_time($curEp.airdate.toordinal(),$curShow.airs,$curShow.network)
|
#set $ldatetime = $network_timezones.parse_date_time($nextAirdate,$curShow.airs,$curShow.network)
|
||||||
<td align="center" class="nowrap" style="color: #555555;font-weight:bold;"><div class="${fuzzydate}">$sbdatetime.sbdatetime.sbfdate($ldatetime)</div><span class="sort_data">$time.mktime($ldatetime.timetuple())</span> </td>
|
<td align="center" class="nowrap" style="color: #555555;font-weight:bold;"><div class="${fuzzydate}">$sbdatetime.sbdatetime.sbfdate($ldatetime)</div><span class="sort_data">$time.mktime($ldatetime.timetuple())</span> </td>
|
||||||
#else:
|
#else:
|
||||||
<td align="center" class="nowrap" style="color: #555555;font-weight:bold;"></td>
|
<td align="center" class="nowrap" style="color: #555555;font-weight:bold;"></td>
|
||||||
|
@ -989,8 +989,8 @@ class TVShow(object):
|
|||||||
else:
|
else:
|
||||||
logger.log(str(self.indexerid) + u": Found episode " + str(sqlResults[0]["season"]) + "x" + str(
|
logger.log(str(self.indexerid) + u": Found episode " + str(sqlResults[0]["season"]) + "x" + str(
|
||||||
sqlResults[0]["episode"]), logger.DEBUG)
|
sqlResults[0]["episode"]), logger.DEBUG)
|
||||||
curEp = self.getEpisode(int(sqlResults[0]["season"]), int(sqlResults[0]["episode"]))
|
#curEp = self.getEpisode(int(sqlResults[0]["season"]), int(sqlResults[0]["episode"]))
|
||||||
return curEp
|
return sqlResults[0]['airdate']
|
||||||
|
|
||||||
def deleteShow(self):
|
def deleteShow(self):
|
||||||
|
|
||||||
|
@ -1758,10 +1758,12 @@ class CMD_Show(ApiCall):
|
|||||||
showDict["network"] = ""
|
showDict["network"] = ""
|
||||||
showDict["status"] = showObj.status
|
showDict["status"] = showObj.status
|
||||||
|
|
||||||
nextAirdate = ''
|
nextAirdate = showObj.nextEpisode()
|
||||||
nextEp = showObj.nextEpisode()
|
if nextAirdate:
|
||||||
if nextEp:
|
nextAirdate = _ordinal_to_dateForm(nextAirdate)
|
||||||
nextAirdate = _ordinal_to_dateForm(nextEp.airdate.toordinal())
|
else:
|
||||||
|
nextAirdate = ''
|
||||||
|
|
||||||
showDict["next_ep_airdate"] = nextAirdate
|
showDict["next_ep_airdate"] = nextAirdate
|
||||||
|
|
||||||
return _responds(RESULT_SUCCESS, showDict)
|
return _responds(RESULT_SUCCESS, showDict)
|
||||||
@ -2500,10 +2502,11 @@ class CMD_Shows(ApiCall):
|
|||||||
""" display_is_int_multi( self.indexerid )shows in sickbeard """
|
""" display_is_int_multi( self.indexerid )shows in sickbeard """
|
||||||
shows = {}
|
shows = {}
|
||||||
for curShow in sickbeard.showList:
|
for curShow in sickbeard.showList:
|
||||||
nextAirdate = ''
|
nextAirdate = curShow.nextEpisode()
|
||||||
nextEp = curShow.nextEpisode()
|
if nextAirdate:
|
||||||
if nextEp:
|
nextAirdate = _ordinal_to_dateForm(nextAirdate)
|
||||||
nextAirdate = _ordinal_to_dateForm(nextEp.airdate.toordinal())
|
else:
|
||||||
|
nextAirdate = ''
|
||||||
|
|
||||||
if self.paused != None and bool(self.paused) != bool(curShow.paused):
|
if self.paused != None and bool(self.paused) != bool(curShow.paused):
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user