#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 $downloadedEps = $myDB.select("SELECT showid, COUNT(*) FROM tv_episodes WHERE (status IN ("+",".join([str(x) for x in $Quality.DOWNLOADED + [$ARCHIVED]])+") OR (status IN ("+",".join([str(x) for x in $Quality.SNATCHED + $Quality.SNATCHED_PROPER])+") AND location != '')) AND season != 0 and episode != 0 AND airdate <= "+$today+" GROUP BY showid") #set $allEps = $myDB.select("SELECT showid, COUNT(*) FROM tv_episodes WHERE season != 0 and episode != 0 AND (airdate != 1 OR status IN ("+",".join([str(x) for x in ($Quality.DOWNLOADED + $Quality.SNATCHED + $Quality.SNATCHED_PROPER) + [$ARCHIVED]])+")) AND airdate <= "+$today+" AND status != "+str($IGNORED)+" GROUP BY showid") #set $layout = $sickbeard.HOME_LAYOUT #if $varExists('header')

$header

#else

$title

#end if
Layout: Poster · Banner · Simple
#for $curShowlist in $showlists: #set $curListType = $curShowlist[0] #set $myShowList = $list($curShowlist[1]) #if $curListType == "Anime":

Anime List

#end if #if $layout=="poster" then "" else ""# #for $curLoadingShow in $sickbeard.showQueueScheduler.action.loadingShowList: #if $curLoadingShow.show != None and $curLoadingShow.show in $sickbeard.showList: #continue #end if #end for $myShowList.sort(lambda x, y: cmp(x.name, y.name)) #for $curShow in $myShowList: #set $curEp = $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] #if len($curShowAll) != 0: #if len($curShowDownloads) != 0: #set $dlStat = str($curShowDownloads[0])+" / "+str($curShowAll[0]) #set $nom = $curShowDownloads[0] #set $den = $curShowAll[0] #else #set $dlStat = "0 / "+str($curShowAll[0]) #set $nom = 0 #set $den = $curShowAll[0] #end if #else #set $dlStat = "0" #set $nom = 0 #set $den = 1 #end if #set $which_thumb = $layout+"_thumb" #if len($curEp) != 0: #set $ldatetime = $network_timezones.parse_date_time($curEp[0].airdate.toordinal(),$curShow.airs,$curShow.network) #else: #end if #if $layout == 'poster': #else if $layout == 'banner': #else if $layout == 'simple': #end if #if $curShow.quality in $qualityPresets: #else: #end if #end for
Next EpPosterShowNetworkQualityDownloadsActiveStatus
  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())
$curShow.name $curShow.name $curShow.name #if $layout != 'simple': #if $curShow.network: $curShow.network #else: No Network #end if #else: $curShow.network #end if $qualityPresetStrings[$curShow.quality]Custom$dlStat
\"Y\"" $curShow.status
#end for #include $os.path.join($sickbeard.PROG_DIR,"gui/slick/interfaces/default/inc_bottom.tmpl")