mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-04 10:23:37 +00:00
aa69cfb07c
Split downloaded and snatched Use > instead of != in sql statement (speed improvement) Today's Next Episode removes correctly if today's date is snatched or downloaded (fix) Progressbar percentage calculated in python (speed improvement) Episode totals corrected (fix)
54 lines
No EOL
2.7 KiB
Cheetah
54 lines
No EOL
2.7 KiB
Cheetah
#import sickbeard
|
|
#import datetime
|
|
#from sickbeard import db, sbdatetime
|
|
#from sickbeard.common import *
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="footer clearfix">
|
|
<div class="meta" style="float:left;font-size: 12px;">
|
|
#set $myDB = $db.DBConnection()
|
|
#set $today = str($datetime.date.today().toordinal())
|
|
#set status_quality = '(' + ','.join([str(quality) for quality in $Quality.SNATCHED + $Quality.SNATCHED_PROPER]) + ')'
|
|
#set status_download = '(' + ','.join([str(quality) for quality in $Quality.DOWNLOADED + [$ARCHIVED]]) + ')'
|
|
|
|
#set $sql_statement = 'SELECT '
|
|
|
|
#set $sql_statement += '(SELECT COUNT(*) FROM tv_episodes WHERE 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 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 season > 0 AND episode > 0 AND airdate > 1 '
|
|
#set $sql_statement += ' AND ((airdate <= ' + $today + ' AND (status = ' + str($SKIPPED) + ' OR status = ' + str($WANTED) + ')) '
|
|
#set $sql_statement += ' OR (status IN ' + status_quality + ') OR (status IN ' + status_download + '))) AS ep_total '
|
|
|
|
#set $sql_statement += ' FROM tv_episodes tv_eps LIMIT 1'
|
|
|
|
#set $sql_result = $myDB.select($sql_statement)
|
|
|
|
#set $shows_total = len($sickbeard.showList)
|
|
#set $shows_active = len([show for show in $sickbeard.showList if show.paused == 0 and show.status != "Ended"])
|
|
|
|
#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
|
|
|
|
<b>$shows_total</b> Shows (<b>$shows_active</b> Active) <b>|</b> <b><%=ep_downloaded%>#if $ep_snatched > 0 then " (+" + str($ep_snatched) + " snatched)" else ""# / $ep_total</b> Episodes Downloaded <b>|</b> Daily Search: <b><%=str(sickbeard.dailySearchScheduler.timeLeft()).split('.')[0]%></b> <b>|</b> Backlog Search: <b>$sbdatetime.sbdatetime.sbfdate($sickbeard.backlogSearchScheduler.nextRun())</b>
|
|
|
|
</div>
|
|
|
|
<ul style="float:right; font-size: 12px;">
|
|
<li><a href="$sbRoot/manage/manageSearches/forceVersionCheck"><img src="$sbRoot/images/menu/update16.png" alt="" width="16" height="16" />Force Version Check</a></li>
|
|
<li><a href="$sbRoot/home/restart/?pid=$sbPID" class="confirm"><img src="$sbRoot/images/menu/restart16.png" alt="" width="16" height="16" />Restart</a></li>
|
|
<li><a href="$sbRoot/home/shutdown/?pid=$sbPID" class="confirm"><img src="$sbRoot/images/menu/shutdown16.png" alt="" width="16" height="16" />Shutdown</a></li>
|
|
</ul>
|
|
</div>
|
|
|
|
</body>
|
|
</html> |