1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-08-13 16:53:54 -04:00

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.
This commit is contained in:
JackDandy 2014-10-14 17:17:33 +01:00
parent 2d18f5b8ab
commit 397cc09610

View File

@ -23,14 +23,15 @@
<table id="trakt" width="100%" cellspacing="1" border="0" cellpadding="0">
#for $i, $cur_show in $enumerate($trending_shows):
#if not $i%6
#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="${cur_show["images"]["poster"]}" /></a>
<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>