2014-03-10 01:18:05 -04:00
#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
2014-07-21 01:38:50 -04:00
#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 '
2014-10-09 22:54:39 -04:00
#set $ sql_statement + = ' AND ((airdate <= ' + $ today + ' AND (status = ' + str ( $ SKIPPED ) + ' OR status = ' + str ( $ WANTED ) + ' OR status = ' + str ( $ FAILED ) + ' )) '
2014-07-21 01:38:50 -04:00
#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
2014-03-10 01:18:05 -04:00
<script type="text/javascript" charset="utf-8">
<!--
\$.tablesorter.addParser({
id: 'loadingNames',
is: function(s) {
return false;
},
format: function(s) {
if (s.indexOf('Loading...') == 0)
2014-10-21 15:09:01 -04:00
return s.replace('Loading...','000');
2014-03-10 01:18:05 -04:00
else
#if not $ sickbeard . SORT_ARTICLE :
return (s || '').replace(/^(The|A|An)\s/i,'');
#else :
return (s || '');
#end if
},
type: 'text'
});
\$.tablesorter.addParser({
id: 'quality',
is: function(s) {
return false;
},
format: function(s) {
2014-10-21 15:09:01 -04:00
return s.replace('hd1080p',5).replace('hd720p',4).replace('hd',3).replace('sd',2).replace('any',1).replace('custom',7);
2014-03-10 01:18:05 -04:00
},
type: 'numeric'
});
\$(document).ready(function(){
2014-10-21 15:09:01 -04:00
2014-03-10 01:18:05 -04:00
\$("img #network " ).on( ' error ' , function() {
\$(this).parent().text(\$(this).attr('alt'));
\$(this).remove();
});
2014-05-27 03:44:23 -04:00
\$(" #showListTableShows : has ( tbody tr ) " ).tablesorter( {
2014-10-21 15:09:01 -04:00
sortList: [[5,1],[1,0]],
textExtraction: {
0: function(node) { return \$(node).find("span").text().toLowerCase(); },
3: function(node) { return \$(node).find("span").text().toLowerCase(); },
4: function(node) { return \$(node).find("span").text(); },
5: function(node) { return \$(node).find("img").attr("alt"); }
},
widgets: ['saveSort', 'zebra', 'stickyHeaders', 'filter'],
headers: {
0: { sorter: 'isoDate' },
1: { sorter: 'loadingNames' },
3: { sorter: 'quality' },
4: { sorter: 'eps' }
},
widgetOptions : {
filter_columnFilters: false,
filter_reset: '.resetshows'
},
sortStable: true
2014-03-10 01:18:05 -04:00
});
2014-10-21 15:09:01 -04:00
\$(" #showListTableAnime : has ( tbody tr ) " ).tablesorter( {
sortList: [[5,1],[1,0]],
textExtraction: {
0: function(node) { return \$(node).find("span").text().toLowerCase(); },
3: function(node) { return \$(node).find("span").text().toLowerCase(); },
4: function(node) { return \$(node).find("span").text(); },
5: function(node) { return \$(node).find("img").attr("alt"); }
},
widgets: ['saveSort', 'zebra', 'stickyHeaders', 'filter'],
headers: {
0: { sorter: 'isoDate' },
1: { sorter: 'loadingNames' },
3: { sorter: 'quality' },
4: { sorter: 'eps' }
},
widgetOptions : {
filter_columnFilters: false,
filter_reset: '.resetanime'
},
sortStable: true
2014-05-27 03:44:23 -04:00
});
2014-05-27 18:17:24 -04:00
2014-10-21 15:09:01 -04:00
\$.tablesorter.filter.bindSearch( " #showListTableShows " , \ $( ' .search ' ) );
#if $ sickbeard . ANIME_SPLIT_HOME :
\$.tablesorter.filter.bindSearch( " #showListTableAnime " , \ $( ' .search ' ) );
#end if
2014-05-23 11:20:44 -04:00
#set $ fuzzydate = ' airdate '
#if $ sickbeard . FUZZY_DATING :
fuzzyMoment({
2014-10-14 00:13:59 -04:00
dtInline : #if $ layout == ' poster ' then " true " else " false " # ,
2014-05-23 11:20:44 -04:00
containerClass : '. ${ fuzzydate } ',
dateHasTime : false,
dateFormat : ' ${ sickbeard . DATE_PRESET } ',
timeFormat : ' ${ sickbeard . TIME_PRESET } ',
trimZero : #if $ sickbeard . TRIM_ZERO then " true " else " false " #
});
#end if
2014-10-21 15:09:01 -04:00
var \ $ container = [\$(' #container ' ), \ $( ' # container-anime')];
jQuery.each(\ $ container , function (j) {
this.isotope({
itemSelector: '.show',
2014-10-26 01:42:45 -04:00
sortBy : ' $ sickbeard . POSTER_SORTBY ',
sortAscending: $ sickbeard . POSTER_SORTDIR ,
2014-10-21 15:09:01 -04:00
layoutMode: 'masonry',
masonry: {
columnWidth: 12,
isFitWidth: true
},
getSortData: {
name: function( itemElem ) {
var name = \$( itemElem ).attr('data-name');
#if not $ sickbeard . SORT_ARTICLE :
return (name || '').replace(/^(The|A|An)\s/i,'');
#else :
return (name || '');
#end if
},
network: '[data-network]',
2014-10-26 01:42:45 -04:00
date: function( itemElem ) {
2014-10-21 15:09:01 -04:00
var date = \$( itemElem ).attr('data-date');
2014-10-26 01:42:45 -04:00
return date.length && parseInt( date, 10 ) || Number.POSITIVE_INFINITY;
2014-10-21 15:09:01 -04:00
},
progress: function( itemElem ) {
var progress = \$( itemElem ).attr('data-progress');
2014-11-08 22:49:19 -05:00
return progress.length && parseInt( progress, 10 ) || Number.NEGATIVE_INFINITY;
2014-10-21 15:09:01 -04:00
}
}
});
});
2014-05-23 11:20:44 -04:00
2014-10-21 15:09:01 -04:00
\$(' #postersort ' ).on( ' change ' , function() {
var sortValue = this.value;
\$(' #container ' ).isotope( { sortBy: sortValue });
\$(' #container - anime ' ).isotope( { sortBy: sortValue });
2014-10-26 01:42:45 -04:00
\$.get(this.options[this.selectedIndex].getAttribute('data-sort'));
2014-10-21 15:09:01 -04:00
});
\$(' #postersortdirection ' ).on( ' change ' , function() {
var sortDirection = this.value;
sortDirection = sortDirection == 'true';
\$(' #container ' ).isotope( { sortAscending: sortDirection });
\$(' #container - anime ' ).isotope( { sortAscending: sortDirection });
2014-10-26 01:42:45 -04:00
\$.get(this.options[this.selectedIndex].getAttribute('data-sort'));
2014-10-21 15:09:01 -04:00
});
2014-03-10 01:18:05 -04:00
});
//-->
</script>
#if $ varExists ( ' header ' )
<h1 class="header"> $ header </h1>
#else
<h1 class="title"> $ title </h1>
#end if
2014-10-21 15:09:01 -04:00
<div id="HomeLayout" class="pull-right" style="margin-top: -40px;">
<span> Layout:
<select name="layout" class="form-control form-control-inline input-sm" onchange="location = this.options[this.selectedIndex].value;">
<option value=" $ sbRoot /setHomeLayout/?layout=poster" #if $ sickbeard . HOME_LAYOUT == " poster " then " selected= \" selected \" " else " " # >Poster</option>
<option value=" $ sbRoot /setHomeLayout/?layout=small" #if $ sickbeard . HOME_LAYOUT == " small " then " selected= \" selected \" " else " " # >Small Poster</option>
<option value=" $ sbRoot /setHomeLayout/?layout=banner" #if $ sickbeard . HOME_LAYOUT == " banner " then " selected= \" selected \" " else " " # >Banner</option>
<option value=" $ sbRoot /setHomeLayout/?layout=simple" #if $ sickbeard . HOME_LAYOUT == " simple " then " selected= \" selected \" " else " " # >Simple</option>
</select>
2014-12-08 09:13:07 -05:00
#if $ layout != ' poster ' :
Search:
<input class="search form-control form-control-inline input-sm input200" type="search" data-column="1" placeholder="Search Show Name"> <button type="button" class="resetshows resetanime btn btn-inline">Reset Search</button>
#end if
2014-03-10 01:18:05 -04:00
</span>
2014-09-30 18:20:37 -04:00
#if $ layout == ' poster ' :
2014-10-21 15:09:01 -04:00
<span> Sort By:
<select id="postersort" class="form-control form-control-inline input-sm">
2014-10-26 01:42:45 -04:00
<option value="name" data-sort=" $ sbRoot /setPosterSortBy/?sort=name" #if $ sickbeard . POSTER_SORTBY == " name " then " selected= \" selected \" " else " " # >Name</option>
<option value="date" data-sort=" $ sbRoot /setPosterSortBy/?sort=date" #if $ sickbeard . POSTER_SORTBY == " date " then " selected= \" selected \" " else " " # >Next Episode</option>
<option value="network" data-sort=" $ sbRoot /setPosterSortBy/?sort=network" #if $ sickbeard . POSTER_SORTBY == " network " then " selected= \" selected \" " else " " # >Network</option>
<option value="progress" data-sort=" $ sbRoot /setPosterSortBy/?sort=progress" #if $ sickbeard . POSTER_SORTBY == " progress " then " selected= \" selected \" " else " " # >Progress</option>
2014-10-21 15:09:01 -04:00
</select>
</span>
<span> Sort Order:
<select id="postersortdirection" class="form-control form-control-inline input-sm">
2014-10-26 01:42:45 -04:00
<option value="true" data-sort=" $ sbRoot /setPosterSortDir/?direction=1" #if $ sickbeard . POSTER_SORTDIR == 1 then " selected= \" selected \" " else " " # >Asc</option>
<option value="false" data-sort=" $ sbRoot /setPosterSortDir/?direction=0" #if $ sickbeard . POSTER_SORTDIR == 0 then " selected= \" selected \" " else " " # >Desc</option>
2014-10-21 15:09:01 -04:00
</select>
</span>
2014-09-30 18:20:37 -04:00
#end if
2014-03-10 01:18:05 -04:00
</div>
2014-06-12 14:30:59 -04:00
#for $ curShowlist in $ showlists :
2014-05-27 03:44:23 -04:00
#set $ curListType = $ curShowlist [ 0 ]
#set $ myShowList = $ list ( $ curShowlist [ 1 ] )
#if $ curListType == " Anime " :
2014-09-30 18:20:37 -04:00
<h1 class="header">Anime List</h1>
2014-05-27 03:44:23 -04:00
#end if
2014-09-30 18:20:37 -04:00
#if $ layout == ' poster ' :
<div id= #if $ curListType == " Anime " and $ layout == ' poster ' then " container-anime " else " container " # class="clearfix">
2014-10-21 15:09:01 -04:00
<div class="posterview">
2014-09-30 18:20:37 -04:00
#for $ curLoadingShow in $ sickbeard . showQueueScheduler . action . loadingShowList :
#if $ curLoadingShow . show != None and $ curLoadingShow . show in $ sickbeard . showList :
#continue
#end if
#if $ curLoadingShow . show == None :
<div class="show" data-name="0" data-date="010101" data-network="0" data-progress="101">
<img alt="" title=" $ curLoadingShow . show_name " class="show-image" style="border-bottom: 1px solid #111;" src=" $ sbRoot /images/poster.png" />
<div class="show-details">
<div class="show-add">Loading... ( $ curLoadingShow . show_name )</div>
</div>
</div>
#end if
#end for
$ myShowList . sort (lambda x, y: cmp(x.name, y.name))
#for $ curShow in $ myShowList :
#set $ cur_airs_next = ' '
#set $ cur_snatched = 0
#set $ cur_downloaded = 0
#set $ cur_total = 0
#set $ download_stat_tip = ' '
2014-11-23 05:28:52 -05:00
#set $ display_status = $ curShow . status
#if None is not $ display_status
#if re . search ( r ' (?i)(?:new|returning) \ s*series ' , $ curShow . status )
#set $ display_status = ' Continuing '
#else if re . search ( r ' (?i)(?:nded) ' , $ curShow . status )
#set $ display_status = ' Ended '
#end if
2014-10-27 15:39:15 -04:00
#end if
2014-09-30 18:20:37 -04:00
#if $ curShow . indexerid in $ show_stat :
#set $ cur_airs_next = $ show_stat [ $ curShow . indexerid ] [ ' ep_airs_next ' ]
2014-03-10 01:18:05 -04:00
2014-09-30 18:20:37 -04:00
#set $ cur_snatched = $ show_stat [ $ curShow . indexerid ] [ ' ep_snatched ' ]
#if not $ cur_snatched :
#set $ cur_snatched = 0
#end if
#set $ cur_downloaded = $ show_stat [ $ curShow . indexerid ] [ ' ep_downloaded ' ]
#if not $ cur_downloaded :
#set $ cur_downloaded = 0
#end if
#set $ cur_total = $ show_stat [ $ curShow . indexerid ] [ ' ep_total ' ]
#if not $ cur_total :
#set $ cur_total = 0
#end if
#end if
#if $ cur_total != 0 :
#set $ download_stat = str ( $ cur_downloaded )
#set $ download_stat_tip = " Downloaded: " + str ( $ cur_downloaded )
#if $ cur_snatched > 0 :
2014-10-01 19:36:55 -04:00
#set $ download_stat = download_stat
2014-09-30 18:20:37 -04:00
#set $ download_stat_tip = download_stat_tip + " & # 013;" + "Snatched: " + str( $ cur_snatched )
#end if
#set $ download_stat = download_stat + " / " + str ( $ cur_total )
#set $ download_stat_tip = download_stat_tip + " & # 013;" + "Total: " + str( $ cur_total )
#else
#set $ download_stat = ' ? '
#set $ download_stat_tip = " no data "
#end if
#set $ nom = $ cur_downloaded
#set $ den = $ cur_total
#if $ den == 0 :
#set $ den = 1
#end if
2014-10-21 15:09:01 -04:00
#set $ progressbar_percent = $ nom * 100 / $ den
2014-10-01 19:36:55 -04:00
2014-10-30 10:03:40 -04:00
#set $ data_date = ' 6000000000.0 '
2014-10-27 15:39:15 -04:00
#if $ cur_airs_next :
2014-11-05 06:33:05 -05:00
#set $ data_date = $ time . mktime ( $ sbdatetime . sbdatetime . convert_to_setting ( $ network_timezones . parse_date_time ( $ cur_airs_next , $ curShow . airs , $ curShow . network ) ) . timetuple ( ) )
2014-10-30 08:32:30 -04:00
#else if None is not $ display_status
#if ' nded ' not in $ display_status and 1 == int ( $ curShow . paused )
#set $ data_date = ' 5000000500.0 '
#else if ' ontinu ' in $ display_status
#set $ data_date = ' 5000000000.0 '
#else if ' nded ' in $ display_status
#set $ data_date = ' 5000000100.0 '
#end if
2014-10-27 15:39:15 -04:00
#end if
<div class="show" id="show $ curShow . indexerid " data-name=" $ curShow . name " data-date=" $ data_date " data-network=" $ curShow . network " data-progress=" $ progressbar_percent ">
2014-09-30 18:20:37 -04:00
<div class="show-image">
<a href=" $ sbRoot /home/displayShow?show= $ curShow . indexerid "><img alt="" class="show-image" src=" $ sbRoot /showPoster/?show= $ curShow . indexerid &which=poster_thumb" /></a>
</div>
2014-10-21 15:09:01 -04:00
2014-09-30 18:20:37 -04:00
<div id="progressbar $ curShow . indexerid "></div>
<script type="text/javascript">
<!--
\$(function() {
\$("\ #progressbar $ curShow . indexerid " ).progressbar( {
value: $ progressbar_percent });
classvalue = $ progressbar_percent
if (classvalue<20) {
classtoadd = "progress-20"
}
if (classvalue>20 && classvalue<60) {
classtoadd = "progress-40"
}
if (classvalue>40 && classvalue<80) {
classtoadd = "progress-60"
}
if (classvalue>80) {
classtoadd = "progress-80"
}
\$("\ #progressbar $ curShow . indexerid > . ui - progressbar - value " ).addClass(classtoadd);
});
//-->
</script>
2014-10-21 15:09:01 -04:00
<div class="show-title">
$ curShow . name
</div>
2014-10-27 15:39:15 -04:00
<div class="show-date">
#if $ cur_airs_next
2014-11-05 06:33:05 -05:00
#set $ ldatetime = $ sbdatetime . sbdatetime . convert_to_setting ( $ network_timezones . parse_date_time ( $ cur_airs_next , $ curShow . airs , $ curShow . network ) )
2014-10-27 15:39:15 -04:00
<span class=" ${ fuzzydate } "> $ sbdatetime . sbdatetime . sbfdate ( $ ldatetime )</span>
#else
2014-10-30 08:32:30 -04:00
#set $ output_html = ' ? '
#if None is not $ display_status
#if ' nded ' not in $ display_status and 1 == int ( $ curShow . paused )
#set $ output_html = ' Paused '
#else if $ display_status
#set $ output_html = $ display_status
#end if
#end if
$ output_html
2014-10-27 15:39:15 -04:00
#end if
</div>
2014-10-21 15:09:01 -04:00
<table width="100%" cellspacing="1" border="0" cellpadding="0">
2014-10-14 00:13:59 -04:00
<tr>
2014-10-21 15:09:01 -04:00
<td class="show-table">
2014-10-14 00:13:59 -04:00
<span class="show-dlstats" title=" $ download_stat_tip "> $ download_stat </span>
</td>
2014-10-21 15:09:01 -04:00
<td class="show-table">
#if $ layout != ' simple ' :
2014-10-08 00:48:35 -04:00
#if $ curShow . network :
2014-10-21 15:09:01 -04:00
<img class="show-network-image" src=" $ sbRoot /images/network/ ${ curShow . network . replace ( u " \u00C9 " , ' e ' ) . lower ( ) } .png" alt=" $ curShow . network " title=" $ curShow . network " />
2014-10-08 00:48:35 -04:00
#else :
2014-10-21 15:09:01 -04:00
<img class="show-network-image" src=" $ sbRoot /images/network/nonetwork.png" alt="No Network" title="No Network" />
2014-10-08 00:48:35 -04:00
#end if
2014-10-01 19:36:55 -04:00
#else :
$ curShow . network
2014-10-21 15:09:01 -04:00
#end if
</td>
<td class="show-table">
#if $ curShow . quality in $ qualityPresets :
<span class="show-quality"> $ qualityPresetStrings [ $ curShow . quality ]</span>
#else :
<span class="show-quality">Custom</span>
2014-10-01 19:36:55 -04:00
#end if
</td>
</tr>
</table>
2014-10-21 15:09:01 -04:00
2014-09-30 18:20:37 -04:00
</div>
2014-10-21 15:09:01 -04:00
2014-09-30 18:20:37 -04:00
#end for
</div>
2014-10-21 15:09:01 -04:00
</div>
2014-09-30 18:20:37 -04:00
#else
<table id="showListTable $ curListType " class="tablesorter" cellspacing="1" border="0" cellpadding="0">
2014-10-21 15:09:01 -04:00
<thead>
<tr>
<th class="nowrap">Next Ep</th>
<th>Show</th>
<th>Network</th>
<th>Quality</th>
<th>Downloads</th>
<th>Active</th>
<th>Status</th>
</tr>
</thead>
<tfoot>
<tr>
2014-12-10 18:52:28 -05:00
<th rowspan="1" colspan="1" align="center"><a href=" $ sbRoot /home/addShows/">Add Show</a></th>
2014-10-21 15:09:01 -04:00
<th rowspan="1" colspan="6"></th>
</tr>
</tfoot>
<tbody>
2014-03-10 01:18:05 -04:00
#for $ curLoadingShow in $ sickbeard . showQueueScheduler . action . loadingShowList :
#if $ curLoadingShow . show != None and $ curLoadingShow . show in $ sickbeard . showList :
#continue
#end if
<tr>
<td align="center">(loading)</td>
<td></td>
<td>
#if $ curLoadingShow . show == None :
Loading... ( $ curLoadingShow . show_name )
#else :
<a href="displayShow?show= $ curLoadingShow . show . indexerid "> $ curLoadingShow . show . name </a>
#end if
</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
#end for
$ myShowList . sort (lambda x, y: cmp(x.name, y.name))
#for $ curShow in $ myShowList :
2014-07-21 01:38:50 -04:00
#set $ cur_airs_next = ' '
#set $ cur_snatched = 0
#set $ cur_downloaded = 0
#set $ cur_total = 0
#set $ download_stat_tip = ' '
#if $ curShow . indexerid in $ show_stat :
#set $ cur_airs_next = $ show_stat [ $ curShow . indexerid ] [ ' ep_airs_next ' ]
#set $ cur_snatched = $ show_stat [ $ curShow . indexerid ] [ ' ep_snatched ' ]
#if not $ cur_snatched :
#set $ cur_snatched = 0
#end if
#set $ cur_downloaded = $ show_stat [ $ curShow . indexerid ] [ ' ep_downloaded ' ]
#if not $ cur_downloaded :
#set $ cur_downloaded = 0
#end if
#set $ cur_total = $ show_stat [ $ curShow . indexerid ] [ ' ep_total ' ]
#if not $ cur_total :
#set $ cur_total = 0
#end if
#end if
#if $ cur_total != 0 :
#set $ download_stat = str ( $ cur_downloaded )
#set $ download_stat_tip = " Downloaded: " + str ( $ cur_downloaded )
#if $ cur_snatched > 0 :
#set $ download_stat = download_stat + " + " + str ( $ cur_snatched )
#set $ download_stat_tip = download_stat_tip + " & # 013;" + "Snatched: " + str( $ cur_snatched )
#end if
#set $ download_stat = download_stat + " / " + str ( $ cur_total )
#set $ download_stat_tip = download_stat_tip + " & # 013;" + "Total: " + str( $ cur_total )
#else
#set $ download_stat = ' ? '
#set $ download_stat_tip = " no data "
#end if
#set $ nom = $ cur_downloaded
#set $ den = $ cur_total
#if $ den == 0 :
#set $ den = 1
#end if
2014-10-21 15:09:01 -04:00
#set $ progressbar_percent = $ nom * 100 / $ den
2014-03-10 01:18:05 -04:00
2014-10-21 15:09:01 -04:00
<tr>
#if $ cur_airs_next
2014-11-05 06:33:05 -05:00
#set $ ldatetime = $ sbdatetime . sbdatetime . convert_to_setting ( $ network_timezones . parse_date_time ( $ cur_airs_next , $ curShow . airs , $ curShow . network ) )
2014-10-21 15:09:01 -04:00
<td align="center" class="nowrap"><div class=" ${ fuzzydate } "> $ sbdatetime . sbdatetime . sbfdate ( $ ldatetime )</div><span class="sort_data"> $ time . mktime ( $ ldatetime . timetuple ())</span></td>
2014-03-10 01:18:05 -04:00
#else :
2014-10-08 00:48:35 -04:00
<td align="center" class="nowrap"></td>
2014-03-10 01:18:05 -04:00
#end if
2014-10-21 15:09:01 -04:00
2014-10-08 20:00:36 -04:00
#if $ layout == ' small ' :
2014-10-21 15:09:01 -04:00
<td class="tvShow">
2014-10-08 20:00:36 -04:00
<div class="imgsmallposter $ layout ">
<a href=" $ sbRoot /showPoster/?show= $ curShow . indexerid &which= $ layout " rel="dialog" title=" $ curShow . name ">
<img src=" $ sbRoot /showPoster/?show= $ curShow . indexerid &which=poster_thumb" class=" $ layout " alt=" $ curShow . indexerid "/>
</a>
<a href=" $ sbRoot /home/displayShow?show= $ curShow . indexerid " style="vertical-align: middle;"> $ curShow . name </a>
</div>
</td>
#else if $ layout == ' banner ' :
2014-03-10 01:18:05 -04:00
<td>
<span style="display: none;"> $ curShow . name </span>
2014-09-30 18:20:37 -04:00
<div class="imgbanner $ layout ">
2014-03-10 01:18:05 -04:00
<a href=" $ sbRoot /home/displayShow?show= $ curShow . indexerid ">
2014-09-30 18:20:37 -04:00
<img src=" $ sbRoot /showPoster/?show= $ curShow . indexerid &which=banner" class=" $ layout " alt=" $ curShow . indexerid " title=" $ curShow . name "/>
2014-03-10 01:18:05 -04:00
</div>
</td>
#else if $ layout == ' simple ' :
<td class="tvShow"><a href=" $ sbRoot /home/displayShow?show= $ curShow . indexerid "> $ curShow . name </a></td>
#end if
2014-10-21 15:09:01 -04:00
2014-03-10 01:18:05 -04:00
#if $ layout != ' simple ' :
2014-10-21 15:09:01 -04:00
<td align="center">
2014-03-10 01:18:05 -04:00
#if $ curShow . network :
2014-10-08 00:48:35 -04:00
<img id="network" width="54" height="27" src=" $ sbRoot /images/network/ ${ curShow . network . replace ( u " \u00C9 " , ' e ' ) . lower ( ) } .png" alt=" $ curShow . network " title=" $ curShow . network " />
2014-03-10 01:18:05 -04:00
#else :
2014-09-30 18:20:37 -04:00
<img id="network" width="54" height="27" src=" $ sbRoot /images/network/nonetwork.png" alt="No Network" title="No Network" />
2014-03-10 01:18:05 -04:00
#end if
2014-10-21 15:09:01 -04:00
</td>
2014-03-10 01:18:05 -04:00
#else :
2014-10-21 15:09:01 -04:00
<td>
$ curShow . network
</td>
2014-03-10 01:18:05 -04:00
#end if
2014-10-21 15:09:01 -04:00
#if $ curShow . quality in $ qualityPresets :
<td align="center"><span class="quality $ qualityPresetStrings [ $ curShow . quality ]"> $ qualityPresetStrings [ $ curShow . quality ]</span></td>
#else :
<td align="center"><span class="quality Custom">Custom</span></td>
#end if
<td align="center"><span style="display: none;"> $ progressbar_percent </span><div id="progressbar $ curShow . indexerid " style="position:relative;"></div>
<script type="text/javascript">
<!--
\$(function() {
\$("\ #progressbar $ curShow . indexerid " ).progressbar( {
value: $ progressbar_percent });
\$("\ #progressbar $ curShow . indexerid " ).append( " < div class = ' progressbarText ' title = ' $download_stat_tip ' > $ download_stat < / div > " )
classvalue = $ progressbar_percent
if (classvalue<20) {
classtoadd = "progress-20"
}
if (classvalue>20 && classvalue<60) {
classtoadd = "progress-40"
}
if (classvalue>40 && classvalue<80) {
classtoadd = "progress-60"
}
if (classvalue>80) {
classtoadd = "progress-80"
}
\$("\ #progressbar $ curShow . indexerid > . ui - progressbar - value " ).addClass(classtoadd);
});
//-->
</script>
</td>
<td align="center">
2014-12-13 14:06:33 -05:00
<img src=" $ sbRoot /images/ #if int ( $ curShow . paused ) == 0 and $ curShow . status == " Continuing " then " yes16.png \" alt= \" Y \" " else " no16.png \" alt= \" N \" " # width="16" height="16" />
2014-10-21 15:09:01 -04:00
</td>
<td align="center">
2014-11-23 05:28:52 -05:00
#set $ display_status = $ curShow . status
#if None is not $ display_status
#if re . search ( r ' (?i)(?:new|returning) \ s*series ' , $ curShow . status )
#set $ display_status = ' Continuing '
#else if re . search ( r ' (?i)(?:nded) ' , $ curShow . status )
#set $ display_status = ' Ended '
#end if
2014-10-27 15:39:15 -04:00
#end if
2014-11-23 05:28:52 -05:00
$ display_status
2014-10-21 15:09:01 -04:00
</td>
</tr>
2014-03-10 01:18:05 -04:00
#end for
</tbody>
</table>
2014-10-21 15:09:01 -04:00
2014-09-30 18:20:37 -04:00
#end if
2014-05-27 03:44:23 -04:00
#end for
2014-06-08 00:13:40 -04:00
#include $ os . path . join ( $ sickbeard . PROG_DIR , " gui/slick/interfaces/default/inc_bottom.tmpl " )