2014-03-10 05:18:05 +00:00
|
|
|
#import sickbeard
|
|
|
|
#import datetime
|
2015-03-17 18:58:19 +00:00
|
|
|
#import re
|
2014-03-10 05:18:05 +00:00
|
|
|
#from sickbeard import db, sbdatetime
|
|
|
|
#from sickbeard.common import *
|
2014-07-21 05:38:50 +00:00
|
|
|
|
2014-11-13 17:07:10 +00:00
|
|
|
</div> <!-- /content -->
|
2014-09-30 22:20:37 +00:00
|
|
|
</div> <!-- /contentWrapper -->
|
2014-07-21 05:38:50 +00:00
|
|
|
|
2014-10-21 19:09:01 +00:00
|
|
|
<footer>
|
|
|
|
<div class="footer clearfix">
|
2014-11-13 17:07:10 +00:00
|
|
|
#set $my_db = $db.DBConnection()
|
|
|
|
#set $today = str($datetime.date.today().toordinal())
|
2015-02-14 11:05:35 +00:00
|
|
|
#set status_quality = '(%s)' % ','.join([str(quality) for quality in $Quality.SNATCHED + $Quality.SNATCHED_PROPER])
|
|
|
|
#set status_download = '(%s)' % ','.join([str(quality) for quality in $Quality.DOWNLOADED + [$ARCHIVED]])
|
|
|
|
#set $sql_statement = 'SELECT '\
|
|
|
|
+ '(SELECT COUNT(*) FROM tv_episodes WHERE season > 0 AND episode > 0 AND airdate > 1 AND status IN %s) AS ep_snatched, '\
|
|
|
|
% $status_quality\
|
|
|
|
+ '(SELECT COUNT(*) FROM tv_episodes WHERE season > 0 AND episode > 0 AND airdate > 1 AND status IN %s) AS ep_downloaded, '\
|
|
|
|
% $status_download\
|
|
|
|
+ '(SELECT COUNT(*) FROM tv_episodes WHERE season > 0 AND episode > 0 AND airdate > 1 '\
|
|
|
|
+ ' AND ((airdate <= %s AND (status = %s OR status = %s)) '\
|
|
|
|
% ($today, str($SKIPPED), str($WANTED))\
|
|
|
|
+ ' OR (status IN %s) OR (status IN %s))) AS ep_total FROM tv_episodes tv_eps LIMIT 1'\
|
|
|
|
% ($status_quality, $status_download)
|
2014-11-13 17:07:10 +00:00
|
|
|
|
|
|
|
#set $sql_result = $my_db.select($sql_statement)
|
|
|
|
|
|
|
|
#set $shows_total = len($sickbeard.showList)
|
2015-02-14 11:05:35 +00:00
|
|
|
#set $shows_active = len([show for show in $sickbeard.showList if 0 == show.paused and 'Ended' != show.status])
|
2014-11-13 17:07:10 +00:00
|
|
|
|
|
|
|
#if $sql_result:
|
|
|
|
#set $ep_snatched = $sql_result[0]['ep_snatched']
|
|
|
|
#set $ep_downloaded = $sql_result[0]['ep_downloaded']
|
|
|
|
#set $ep_total = $sql_result[0]['ep_total']
|
|
|
|
#else
|
|
|
|
#set $ep_snatched = 0
|
|
|
|
#set $ep_downloaded = 0
|
|
|
|
#set $ep_total = 0
|
|
|
|
#end if
|
2015-03-17 18:58:19 +00:00
|
|
|
#set $ep_percentage = '' if $ep_total == 0 else '(<span class="footerhighlight">%s%%</span>)' % re.sub(r'(\d+)(\.\d)\d+', r'\1\2', str((float($ep_downloaded)/float($ep_total))*100))
|
2015-02-14 11:05:35 +00:00
|
|
|
|
2014-12-13 15:47:58 +00:00
|
|
|
#try
|
|
|
|
#set $localRoot = $sbRoot
|
|
|
|
#except NotFound
|
|
|
|
#set $localRoot = ''
|
|
|
|
#end try
|
|
|
|
#try
|
|
|
|
#set $localheader = $header
|
|
|
|
#except NotFound
|
|
|
|
#set $localheader = ''
|
|
|
|
#end try
|
2014-11-13 17:07:10 +00:00
|
|
|
|
|
|
|
<span class="footerhighlight">$shows_total</span> shows (<span class="footerhighlight">$shows_active</span> active)
|
2015-02-14 11:05:35 +00:00
|
|
|
| <span class="footerhighlight">$ep_downloaded</span><%=
|
|
|
|
(
|
|
|
|
'',
|
|
|
|
' (<span class="footerhighlight">+%s</span> snatched)'\
|
2015-03-18 22:22:54 +00:00
|
|
|
% '<a href="%s/manage/episodeStatuses?whichStatus=2" title="View overview of snatched episodes">%s</a>'
|
|
|
|
% (localRoot, str(ep_snatched))
|
2015-02-14 11:05:35 +00:00
|
|
|
)[0 < ep_snatched]
|
|
|
|
%> / <span class="footerhighlight">$ep_total</span> episodes downloaded $ep_percentage
|
2014-12-22 18:30:53 +00:00
|
|
|
| recent search: <span class="footerhighlight"><%= str(sickbeard.recentSearchScheduler.timeLeft()).split('.')[0] %></span>
|
2015-01-04 02:26:55 +00:00
|
|
|
| backlog search: <span class="footerhighlight"><%= str(sickbeard.backlogSearchScheduler.timeLeft()).split('.')[0] %></span>
|
2014-09-30 22:20:37 +00:00
|
|
|
|
2014-10-21 19:09:01 +00:00
|
|
|
</div>
|
2014-11-13 17:07:10 +00:00
|
|
|
|
2014-10-21 19:09:01 +00:00
|
|
|
</footer>
|
2014-11-13 17:07:10 +00:00
|
|
|
|
2014-03-10 05:18:05 +00:00
|
|
|
</body>
|
2014-09-30 22:20:37 +00:00
|
|
|
</html>
|