1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-13 11:32:20 -05:00
SickRage/gui/slick/interfaces/default/home_trendingShows.tmpl
JackDandy 397cc09610 Improve addShows trending page by using less memory and loading quicker.
The trending page shows approx. 500 images and typically, the size of fetched images were 1000 x 1500 pixels. The browser was relied on to reduce the images while rendering to 186 x 273 pixels. The result used a *lot* of memory, bandwidth, time, render processing, and server resources to populate the page so those issues have been eased by fetching smaller 300 x 450 pixel images instead.
2014-10-14 17:17:33 +01:00

59 lines
1.7 KiB
Cheetah

#import sickbeard
#import datetime
#import re
#from sickbeard.common import *
#from sickbeard import sbdatetime
#set global $title="Trending Shows"
#set global $header="Trending Shows"
#set global $sbPath=".."
#set global $topmenu="comingEpisodes"
#import os.path
#include $os.path.join($sickbeard.PROG_DIR, "gui/slick/interfaces/default/inc_top.tmpl")
<script type="text/javascript" src="$sbRoot/js/plotTooltip.js?$sbPID"></script>
#if $varExists('header')
<h1 class="header">$header</h1>
#else
<h1 class="title">$title</h1>
#end if
<table id="trakt" width="100%" cellspacing="1" border="0" cellpadding="0">
#for $i, $cur_show in $enumerate($trending_shows):
#set $image = re.sub(r"(.*)(\..*?)$", r"\1-300\2", $cur_show["images"]["poster"], 0, re.IGNORECASE | re.MULTILINE)
#if not $i%5
<tr>
#end if
<td class="trakt_show">
<div class="traktContainer">
<div class="trakt-image">
<a href="${cur_show["url"]}" target="_blank"><img alt="" class="trakt-image" src="${image}" /></a>
<div class="trakt-image-slide">
<p>$cur_show["title"]</p>
</div>
</div>
<div class="clearfix">
<h2>$cur_show["ratings"]["percentage"]% <img src="$sbRoot/images/heart.png"></h2>
<i>$cur_show["ratings"]["votes"] votes</i>
<div class="traktShowTitleIcons">
<a href="$sbRoot/home/addTraktShow?indexer_id=${cur_show["tvdb_id"]}&amp;showName=${cur_show["title"]}" class="btn btn-mini">Add Show</a>
</div>
</div>
</div>
</td>
#end for
</table>
<script type="text/javascript" charset="utf-8">
<!--
window.setInterval( "location.reload(true)", 600000); // Refresh every 10 minutes
//-->
</script>
#include $os.path.join($sickbeard.PROG_DIR, "gui/slick/interfaces/default/inc_bottom.tmpl")