mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-03 18:03:37 +00:00
22ce0203cf
Use to prevent "Update to" on those select episodes while preserving the downloaded quality. Change group "Downloaded" status qualities into one section. Add "Downloaded/with archived quality" to set shows as downloaded using quality of archived status. Add "Archived with/downloaded quality" to set shows as archived using quality of downloaded status. Add "Archived with/default (min. initial quality of show here)". Change when settings/Post Processing/File Handling/Status of removed episodes/Set Archived is enabled, set status and quality accordingly. Add downloaded and archived statuses to Manage/Episode Status. Add quality pills to Manage/Episode Status. Change Manage/Episode Status season output format to be more readable. Change add SNATCHED_ANY and ARCHIVED, refactor accordingly.
80 lines
3.2 KiB
Cheetah
80 lines
3.2 KiB
Cheetah
#import sickbeard
|
|
#import datetime
|
|
#import re
|
|
#from sickbeard import db, sbdatetime
|
|
#from sickbeard.common import *
|
|
<% def sg_var(varname, default=False): return getattr(sickbeard, varname, default) %>#slurp#
|
|
<% def sg_str(varname, default=''): return getattr(sickbeard, varname, default) %>#slurp#
|
|
##
|
|
</div><!-- /content -->
|
|
</div><!-- /contentWrapper -->
|
|
|
|
<footer>
|
|
<div class="footer clearfix">
|
|
#set $my_db = $db.DBConnection()
|
|
#set $today = str($datetime.date.today().toordinal())
|
|
#set status_quality = '(%s)' % ','.join([str(quality) for quality in $Quality.SNATCHED_ANY])
|
|
#set status_download = '(%s)' % ','.join([str(quality) for quality in $Quality.DOWNLOADED + $Quality.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)
|
|
##
|
|
#set $sql_result = $my_db.select($sql_statement)
|
|
##
|
|
#set $shows_total = len($sg_str('showList'))
|
|
#set $shows_active = len([show for show in $sg_str('showList') if 0 == show.paused and 'Ended' != show.status])
|
|
##
|
|
#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
|
|
#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))
|
|
##
|
|
#try
|
|
#set $localRoot = $sbRoot
|
|
#except NotFound
|
|
#set $localRoot = ''
|
|
#end try
|
|
#try
|
|
#set $localheader = $header
|
|
#except NotFound
|
|
#set $localheader = ''
|
|
#end try
|
|
<%
|
|
try:
|
|
next_backlog_timeleft = str(sickbeard.backlogSearchScheduler.next_backlog_timeleft()).split('.')[0]
|
|
except AttributeError:
|
|
next_backlog_timeleft = 'soon'
|
|
try:
|
|
recent_search_timeleft = str(sickbeard.recentSearchScheduler.timeLeft()).split('.')[0]
|
|
except AttributeError:
|
|
recent_search_timeleft = 'soon'
|
|
%>
|
|
##
|
|
<span class="footerhighlight">$shows_total</span> shows (<span class="footerhighlight">$shows_active</span> active)
|
|
| <span class="footerhighlight">$ep_downloaded</span><%=
|
|
(
|
|
'',
|
|
' (<span class="footerhighlight">+%s</span> snatched)'\
|
|
% '<a href="%s/manage/episodeStatuses?whichStatus=2" title="View overview of snatched episodes">%s</a>'
|
|
% (localRoot, str(ep_snatched))
|
|
)[0 < ep_snatched]
|
|
%> / <span class="footerhighlight">$ep_total</span> episodes downloaded $ep_percentage
|
|
| recent search: <span class="footerhighlight">$recent_search_timeleft</span>
|
|
| backlog search: <span class="footerhighlight">$next_backlog_timeleft</span>
|
|
</div>
|
|
</footer>
|
|
</body>
|
|
</html>
|