#import sickbeard #import datetime #from sickbeard.common import * #from sickbeard import db, sbdatetime, network_timezones #set global $title="Home" #set global $header="Show List" #set global $sbPath = ".." #set global $topmenu="home"# #import os.path #include $os.path.join($sickbeard.PROG_DIR, "gui/slick/interfaces/default/inc_top.tmpl") #set $myDB = $db.DBConnection() #set $today = str($datetime.date.today().toordinal()) #set $layout = $sickbeard.HOME_LAYOUT #set status_quality = '(' + ','.join([str(x) for x in $Quality.SNATCHED + $Quality.SNATCHED_PROPER]) + ')' #set status_download = '(' + ','.join([str(x) for x in $Quality.DOWNLOADED + [$ARCHIVED]]) + ')' #set $sql_statement = 'SELECT showid, ' #set $sql_statement += '(SELECT COUNT(*) FROM tv_episodes WHERE showid=tv_eps.showid AND season > 0 AND episode > 0 AND airdate > 1 AND status IN ' + $status_quality + ') AS ep_snatched, ' #set $sql_statement += '(SELECT COUNT(*) FROM tv_episodes WHERE showid=tv_eps.showid AND season > 0 AND episode > 0 AND airdate > 1 AND status IN ' + $status_download + ') AS ep_downloaded, ' #set $sql_statement += '(SELECT COUNT(*) FROM tv_episodes WHERE showid=tv_eps.showid AND season > 0 AND episode > 0 AND airdate > 1 ' #set $sql_statement += ' AND ((airdate <= ' + $today + ' AND (status = ' + str($SKIPPED) + ' OR status = ' + str($WANTED) + ' OR status = ' + str($FAILED) + ')) ' #set $sql_statement += ' OR (status IN ' + status_quality + ') OR (status IN ' + status_download + '))) AS ep_total, ' #set $sql_statement += ' (SELECT airdate FROM tv_episodes WHERE showid=tv_eps.showid AND airdate >= ' + $today + ' AND (status = ' + str($UNAIRED) + ' OR status = ' + str($WANTED) + ') ORDER BY airdate ASC LIMIT 1) AS ep_airs_next ' #set $sql_statement += ' FROM tv_episodes tv_eps GROUP BY showid' #set $sql_result = $myDB.select($sql_statement) #set $show_stat = {} #set $max_download_count = 1000 #for $cur_result in $sql_result: #set $show_stat[$cur_result['showid']] = $cur_result #if $cur_result['ep_total'] > $max_download_count: #set $max_download_count = $cur_result['ep_total'] #end if #end for #set $max_download_count = $max_download_count * 100 #if $varExists('header')
$download_stat | #if $layout != 'simple': #if $curShow.network: #else: #end if #else: $curShow.network #end if | #if $curShow.quality in $qualityPresets: $qualityPresetStrings[$curShow.quality] #else: Custom #end if |
Next Ep | Show | Network | Quality | Downloads | Active | Status | |||||
---|---|---|---|---|---|---|---|---|---|---|---|
Add Show | |||||||||||
(loading) | #if $curLoadingShow.show == None: Loading... ($curLoadingShow.show_name) #else: $curLoadingShow.show.name #end if | ||||||||||
$sbdatetime.sbdatetime.sbfdate($ldatetime) $time.mktime($ldatetime.timetuple()) |
#else:
#end if #if $layout == 'small': | #else if $layout == 'banner': | #else if $layout == 'simple': | $curShow.name | #end if #if $layout != 'simple':#if $curShow.network: #else: #end if | #else:$curShow.network | #end if #if $curShow.quality in $qualityPresets:$qualityPresetStrings[$curShow.quality] | #else:Custom | #end if#if None is not $curShow.status and re.search(r'(?i)(?:new|returning)\s*series', $curShow.status) Continuing #else: $curShow.status #end if |