#import sickgear
#import re
#from sickgear import WEB_ROOT, THEME_NAME
#from sickgear.common import *
#from sickgear.helpers import anon_url, try_float
#from _23 import quote
<% def sg_var(varname, default=False): return getattr(sickgear, varname, default) %>#slurp#
<% def sg_str(varname, default=''): return getattr(sickgear, varname, default) %>#slurp#
##
#set $mode = $kwargs and $kwargs.get('mode', '')
#set $use_network = $kwargs.get('use_networks', False)
#set $use_returning = 'returning' == mode
#set $use_filter = $kwargs and $kwargs.get('use_filter', True)
#set $use_ratings = $kwargs and $kwargs.get('use_ratings', True)
#set $use_votes = $kwargs and $kwargs.get('use_votes', True)
#set $term_vote = $kwargs and $kwargs.get('term_vote', 'Votes')
##
#set global $title='Browse %s Shows' % $browse_type
#set global $header='Browse Shows'
#set global $sbPath='..'
#set global $topmenu='home'
#set global $page_body_attr = 'browse-list" class="%s%s' % ($browse_type.lower(), ('', ' no-votes')[not $use_votes])
#set sg_root = $getVar('sbRoot', WEB_ROOT)
##
#import os.path
#include $os.path.join($sg_str('PROG_DIR'), 'gui/slick/interfaces/default/inc_top.tmpl')
#if $varExists('header')
#set $heading = ('header', $header)
#else
#set $heading = ('title', $title)
#end if
%s' % $heading#
#if $all_shows or ($kwargs and $kwargs.get('show_header'))
#set $num_all = len($all_shows)
#set $selected = ' class="selected" selected="selected"'
> #else#>#end if#All (#echo ('', '%s/' % ($num_all - $num_hidden))[0 < $num_hidden]#$num_all)
> #else#>#end if#Not In Library (#echo $num_all - $num_inlibrary#)
> #else#>#end if#In Library ($num_inlibrary)
#if 'Ani' not in $browse_type
> #else#>#end if#Hidden ($num_hidden)
#end if
> #else#>#end if#Asc
> #else#>#end if#Desc
> #else#>#end if#Name
## omit for TVMaze as original order == First Aired
#if 'TVmaze' not in $browse_type
> #else#>#end if#Original
#end if
> #else#>#end if#First aired
#if $use_returning
> #else#>#end if#Returning
#end if
#if $use_votes
> #else#>#end if#$term_vote
#end if
#if $use_ratings
> #else#>#end if#% Rating
#end if
#if $use_ratings and $use_votes
> #else#>#end if#% Rating > Votes
#end if
#if 'Ani' not in $browse_type and $use_filter
#set $selected = ' class="selected" selected="selected"'
#if 'Trakt' == $browse_type
Anticipating
New Seasons
New Shows
Popular
Trending
Most Watched
Most Played
Most Collected
Most Watched
Most Played
Most Collected
#if any($sg_var('TRAKT_ACCOUNTS', []))
#for $account in $sg_var('TRAKT_ACCOUNTS')
#if $sg_var('TRAKT_ACCOUNTS').get($account).active and $sg_var('TRAKT_ACCOUNTS').get($account).name
for $sg_var('TRAKT_ACCOUNTS').get($account).name
#end if
#end for
#else
Enable Trakt here
#end if
#if any($sg_var('TRAKT_ACCOUNTS', []))
#for $account in $sg_var('TRAKT_ACCOUNTS')
#if $sg_var('TRAKT_ACCOUNTS').get($account).active and $sg_var('TRAKT_ACCOUNTS').get($account).name
for $sg_var('TRAKT_ACCOUNTS').get($account).name
#end if
#end for
#else
Enable Trakt here
#end if
#elif 'IMDb' == $browse_type
#set $periods = $kwargs and $kwargs.get('periods')
#if $periods
#for $i, $p in enumerate($periods)
#set $period='%s,%s' % ($p[0], $p[1])
#echo '%s - %s' % (($p[1], 'Current')[not $i], $p[0])#
#end for
... list more
#end if
#if not hasattr($sickgear, 'IMDB_ACCOUNTS')#new options after restart #else#
#if any($sg_var('IMDB_ACCOUNTS', []))
#for $i, $v in $enumerate($sg_var('IMDB_ACCOUNTS'))
#if not $i % 2
#set $id = $v
#elif not $v.startswith('(Off) ')
#echo '%s%s' % ($v, ('\'s', '')['your' == $v.replace('(Off) ', '').lower()])# list
#end if
#end for
#end if
<< Add lists >>
#end if
#elif 'Metacritic' == $browse_type
New seasons
Last 90 days
By year
Most discussed
Most shared
#if $kwargs and $kwargs.get('more') and 'newseries' in $mode
... list more
#end if
#elif 'TMDB' == $browse_type
Upcoming
Popular
Top rated
Trending today
Trending this week
#elif 'TVCalendar' == $browse_type
#for $page in $kwargs.get('pages') or []
$page[1]
#end for
Latest additions
#elif 'TVmaze' == $browse_type
Premieres
Returning
#elif 'Nextepisode' == $browse_type
Popular premiered
Top rated premiered
Upcoming
Trending
... list more
#end if
#end if
Reset Filter
$browse_title
#if $kwargs and $kwargs.get('oldest')
First aired from $kwargs['oldest'] until $kwargs['newest']
#end if
#end if
#if $all_shows
#set $poster_id = 0
#for $this_show in $all_shows
#set $poster_id += 1
#set $title_html = $this_show['title'].replace('"', '"').replace("'", ''')
#if 'returning' == $mode
#set $overview = '%s: %s' % (
'Season %s' % $this_show['episode_season'],
$this_show['episode_overview'] or $this_show['overview'])
#else
#set $overview = $this_show['overview']
#end if
#set $show_id = $this_show.get('show_id')
#set $known = ('not', '')[bool($this_show.get('indb'))]
#set $hide = ('', '%shide ' % ('', 'to-')['.hide' in $saved_showsort_view])[bool($this_show.get('hide'))]
#if $use_ratings:
#set $data_rating = $try_float($this_show['rating'])
#end if
#echo ((re.sub(r'^((?:A(?!\s+to)n?)|The)\s(\w)', r'\1 \2', $this_show['title']), $this_show['title'])[$sg_var('SORT_ARTICLE')], ' ')['' == $this_show['title']]#
#if 'Ani' not in $browse_type
#end if
#if $use_ratings or $use_votes
#if $use_ratings#$this_show['rating']#if $re.search(r'^\d+(\.\d+)?$', (str($this_show['rating'])))#% #end if##end if##if $use_votes#$this_show['votes'] $term_vote.lower() #end if#
#slurp#
#end if
#if 'url_tvdb' in $this_show and $this_show['url_tvdb']
#end if
#if bool($this_show.get('indb'))
In library
#else
Add Show
#end if
#set $state = 'progress-%s0" title="%s"' % (('2', 'Upcoming'), ('8', 'Started'))[$this_show['started_past']]
$kwargs['footnote']
#end if
#else
#if $kwargs and $kwargs.get('error_msg')
$kwargs['error_msg']
#else
$browse_type did not return results, this can happen from time to time.
This view should auto refresh every 10 mins.
#end if
#end if
#if 'library' in $saved_showsort_view or 'hide' in $saved_showsort_view
#end if
#include $os.path.join($sg_str('PROG_DIR'), 'gui/slick/interfaces/default/inc_bottom.tmpl')