#import sickbeard #import datetime #from sickbeard.common import * #from sickbeard import sbdatetime #from sickbeard.helpers import anon_url #set global $title = 'Coming Episodes' #set global $header = 'Coming Episodes' #set global $sbPath = '..' #set global $topmenu = 'comingEpisodes' #import os.path #include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_top.tmpl') #set $sort = $sickbeard.COMING_EPS_SORT #if $varExists('header')

$header

#else

$title

#end if
Layout:   Sort By:   View Paused:
#if 'calendar' != $layout: Key: Missed Current Future Distant #end if Subscribe

#if 'list' == $layout: #set $show_div = 'listing-default' #for $cur_result in $sql_results: #set $cur_indexer = int($cur_result['indexer']) #set $runtime = $cur_result['runtime'] #if int($cur_result['paused']) and not $sickbeard.COMING_EPS_DISPLAY_PAUSED: #continue #end if #set $cur_ep_airdate = $cur_result['localtime'].date() #if $runtime: #set $cur_ep_enddate = $cur_result['localtime'] + datetime.timedelta(minutes = $runtime) #if $cur_ep_enddate < $today: #set $show_div = 'listing-overdue' #elif $cur_ep_airdate >= $next_week.date(): #set $show_div = 'listing-toofar' #elif $cur_ep_airdate >= $today.date() and $cur_ep_airdate < $next_week.date(): #if $cur_ep_airdate == $today.date(): #set $show_div = 'listing-current' #else: #set $show_div = 'listing-default' #end if #end if #end if ## forced to use a div to wrap airdate, the column sort went crazy with a span #end for
Airdate Show Next Ep Next Ep Name Network Quality Indexers Search
$sbdatetime.sbdatetime.sbfdatetime($cur_result['localtime']).decode($sickbeard.SYS_ENCODING)
$time.mktime($cur_result['localtime'].timetuple())
$cur_result['show_name'] #if int($cur_result['paused']): [paused] #end if <%= 'S%02iE%02i' % (int(cur_result['season']), int(cur_result['episode'])) %> #if $cur_result['description']: #else: #end if $cur_result['name'] $cur_result['network'] #if int($cur_result['quality']) in $qualityPresets: $qualityPresetStrings[int($cur_result['quality'])] #else: Custom #end if #if $cur_result['imdb_id']: [imdb] #end if $sickbeard.indexerApi($cur_indexer).name [search]
 
#else if $layout in ['banner', 'poster']: #set $cur_segment = None #set $too_late_header = False #set $missed_header = False #set $today_header = False #set $show_div = 'ep_listing listing-default' #if 'show' == $sort:

#end if #for $cur_result in $sql_results: #set $cur_indexer = int($cur_result['indexer']) #if int($cur_result['paused']) and not $sickbeard.COMING_EPS_DISPLAY_PAUSED: #continue #end if #set $runtime = $cur_result['runtime'] #if 'network' == $sort: #set $show_network = $cur_result['network'] if $cur_result['network'] else 'no network' #if $cur_segment != $show_network:

$show_network

#set $cur_segment = $cur_result['network'] #end if #set $cur_ep_airdate = $cur_result['localtime'].date() #if $runtime: #set $cur_ep_enddate = $cur_result['localtime'] + datetime.timedelta(minutes = $runtime) #if $cur_ep_enddate < $today: #set $show_div = 'ep_listing listing-overdue' #elif $cur_ep_airdate >= $next_week.date(): #set $show_div = 'ep_listing listing-toofar' #elif $cur_ep_enddate >= $today and $cur_ep_airdate < $next_week.date(): #if $cur_ep_airdate == $today.date(): #set $show_div = 'ep_listing listing-current' #else: #set $show_div = 'ep_listing listing-default' #end if #end if #end if #elif 'date' == $sort: #set $cur_ep_airdate = $cur_result['localtime'].date() #if $cur_segment != $cur_ep_airdate: #if $runtime: #set $cur_ep_enddate = $cur_result['localtime'] + datetime.timedelta(minutes = $runtime) #if $cur_ep_enddate < $today and $cur_ep_airdate != $today.date() and not $missed_header:

Missed

#set $missed_header = True #elif $cur_ep_airdate >= $next_week.date() and not $too_late_header:

Later

#set $too_late_header = True #elif $cur_ep_enddate >= $today and $cur_ep_airdate < $next_week.date(): #if $cur_ep_airdate == $today.date():

$datetime.date.fromordinal($cur_ep_airdate.toordinal).strftime('%A').decode($sickbeard.SYS_ENCODING).capitalize() [Today]

#set $today_header = True #else:

$datetime.date.fromordinal($cur_ep_airdate.toordinal).strftime('%A').decode($sickbeard.SYS_ENCODING).capitalize()

#end if #end if #end if #set $cur_segment = $cur_ep_airdate #end if #if $cur_ep_airdate == $today.date() and not $today_header:

$datetime.date.fromordinal($cur_ep_airdate.toordinal).strftime('%A').decode($sickbeard.SYS_ENCODING).capitalize() [Today]

#set $today_header = True #end if #if $runtime: #if $cur_ep_enddate < $today: #set $show_div = 'ep_listing listing-overdue' #elif $cur_ep_airdate >= $next_week.date(): #set $show_div = 'ep_listing listing-toofar' #elif $cur_ep_enddate >= $today and $cur_ep_airdate < $next_week.date(): #if $cur_ep_airdate == $today.date(): #set $show_div = 'ep_listing listing-current' #else: #set $show_div = 'ep_listing listing-default' #end if #end if #end if #elif 'show' == $sort: #set $cur_ep_airdate = $cur_result['localtime'].date() #if $runtime: #set $cur_ep_enddate = $cur_result['localtime'] + datetime.timedelta(minutes = $runtime) #if $cur_ep_enddate < $today: #set $show_div = 'ep_listing listing-overdue listingradius' #elif $cur_ep_airdate >= $next_week.date(): #set $show_div = 'ep_listing listing-toofar listingradius' #elif $cur_ep_enddate >= $today and $cur_ep_airdate < $next_week.date(): #if $cur_ep_airdate == $today.date(): #set $show_div = 'ep_listing listing-current listingradius' #else: #set $show_div = 'ep_listing listing-default listingradius' #end if #end if #end if #end if
#if 'banner' == $layout: #end if
Next Episode: <%= 'S%02iE%02i' % (int(cur_result['season']), int(cur_result['episode'])) %> - $cur_result['name']
Airs: $sbdatetime.sbdatetime.sbfdatetime($cur_result['localtime']).decode($sickbeard.SYS_ENCODING)<%= ('', ' on %s' % str(cur_result['network']))[None is not cur_result['network']] %>
Quality: #if int($cur_result['quality']) in $qualityPresets: $qualityPresetStrings[int($cur_result['quality'])] #else: Custom #end if
#if $cur_result['description']: Plot:
$cur_result['description']
#else: Plot: #end if
#end for #end if #if 'calendar' == $layout: #set $today = datetime.date.today() #set $dates = [$today + datetime.timedelta(days = $i) for $i in range(7)] #set $tbl_day = 0

#for $day in $dates #set $tbl_day += 1 #set $day_has_show = False #for $cur_result in $sql_results: #if int($cur_result['paused']) and not $sickbeard.COMING_EPS_DISPLAY_PAUSED: #continue #end if #set $cur_indexer = int($cur_result['indexer']) #set $runtime = $cur_result['runtime'] #set $airday = $cur_result['localtime'].date() #if $airday == $day: #set $day_has_show = True #set $airtime = $sbdatetime.sbdatetime.fromtimestamp($time.mktime($cur_result['localtime'].timetuple())).sbftime().decode($sickbeard.SYS_ENCODING) #if $sickbeard.TRIM_ZERO: #set $airtime = re.sub(r'0(\d:\d\d)', r'\1', $airtime, 0, re.IGNORECASE | re.MULTILINE) #end if #end if #end for #if not $day_has_show: #end if
$day.strftime('%A').decode($sickbeard.SYS_ENCODING).capitalize()
${airtime} on $cur_result["network"] <%= 'S%02iE%02i' % (int(cur_result['season']), int(cur_result['episode'])) %> - $cur_result['name']
No shows for this day
#end for
#end if
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_bottom.tmpl')