mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-16 02:02:58 -07:00
Update pms_image_proxy with helper function and encode URL params
This commit is contained in:
parent
3932409fb4
commit
d752d46676
14 changed files with 136 additions and 64 deletions
|
@ -53,11 +53,11 @@ DOCUMENTATION :: END
|
|||
</%doc>
|
||||
|
||||
<%!
|
||||
from plexpy import helpers
|
||||
from plexpy.helpers import cast_to_int, pms_image_proxy
|
||||
|
||||
# Human readable duration
|
||||
def hd(seconds):
|
||||
m, s = divmod(helpers.cast_to_int(seconds), 60)
|
||||
m, s = divmod(cast_to_int(seconds), 60)
|
||||
h, m = divmod(m, 60)
|
||||
return str(h).zfill(1) + ':' + str(m).zfill(2)
|
||||
%>
|
||||
|
@ -73,7 +73,7 @@ DOCUMENTATION :: END
|
|||
<div class="dashboard-stats-container">
|
||||
% if stat_id in ('top_movies', 'popular_movies', 'top_tv', 'popular_tv', 'top_music', 'popular_music', 'last_watched'):
|
||||
<% fallback = 'art-live' if row0['live'] else 'art' %>
|
||||
<div id="stats-background-${stat_id}" class="dashboard-stats-background" style="background-image: url(pms_image_proxy?img=${row0['art']}&rating_key=${row0['rating_key']}&width=500&height=280&opacity=40&background=282828&blur=3&fallback=${fallback});">
|
||||
<div id="stats-background-${stat_id}" class="dashboard-stats-background" style="background-image: url(${pms_image_proxy(row0['art'], row0['rating_key'], 500, 280, 40, '282828', 3, fallback=fallback)});">
|
||||
% elif stat_id == 'top_platforms':
|
||||
<div id="stats-background-${stat_id}" class="dashboard-stats-background platform-${row0['platform_name']}-rgba no-image">
|
||||
% else:
|
||||
|
@ -82,7 +82,7 @@ DOCUMENTATION :: END
|
|||
% if stat_id in ('top_movies', 'popular_movies', 'top_tv', 'popular_tv', 'top_music', 'popular_music', 'last_watched'):
|
||||
<div class="dashboard-stats-poster-container hidden-xs">
|
||||
% if stat_id in ('top_music', 'popular_music'):
|
||||
<div id="stats-thumb-${stat_id}-bg" class="dashboard-stats-poster" style="background-image: url(pms_image_proxy?img=${row0['thumb']}&rating_key=${row0['rating_key']}&width=300&height=300&opacity=60&background=282828&blur=3&fallback=cover);"></div>
|
||||
<div id="stats-thumb-${stat_id}-bg" class="dashboard-stats-poster" style="background-image: url(${pms_image_proxy(row0['thumb'], row0['rating_key'], 300, 300, 60, '282828', 3, fallback='cover')});"></div>
|
||||
% endif
|
||||
<%
|
||||
height, fallback = ('450', 'poster')
|
||||
|
@ -98,7 +98,7 @@ DOCUMENTATION :: END
|
|||
href += '&source=history'
|
||||
%>
|
||||
<a id="stats-thumb-url-${stat_id}" href="${href}" title="${row0['title']}">
|
||||
<div id="stats-thumb-${stat_id}" class="dashboard-stats-${fallback.split('-')[0]}" style="background-image: url(pms_image_proxy?img=${row0['thumb']}&rating_key=${row0['rating_key']}&width=300&height=${height}&fallback=${fallback});"></div>
|
||||
<div id="stats-thumb-${stat_id}" class="dashboard-stats-${fallback.split('-')[0]}" style="background-image: url(${pms_image_proxy(row0['thumb'], row0['rating_key'], 300, height, fallback=fallback)});"></div>
|
||||
</a>
|
||||
</div>
|
||||
% elif stat_id == 'top_users':
|
||||
|
@ -222,9 +222,9 @@ DOCUMENTATION :: END
|
|||
}
|
||||
}
|
||||
$('#stats-thumb-url-' + stat_id).attr('href', href).prop('title', $(elem).data('title'));
|
||||
$('#stats-background-' + stat_id).css('background-image', 'url(pms_image_proxy?img=' + art + '&rating_key=' + rating_key + '&width=500&height=280&opacity=40&background=282828&blur=3&fallback=' + fallback_art + ')');
|
||||
$('#stats-thumb-' + stat_id).css('background-image', 'url(pms_image_proxy?img=' + thumb + '&rating_key=' + rating_key + '&width=300&height=' + height + '&fallback=' + fallback_poster + ')');
|
||||
$('#stats-thumb-' + stat_id + '-bg').css('background-image', 'url(pms_image_proxy?img=' + thumb + '&rating_key=' + rating_key + '&width=300&height=' + height + '&opacity=60&background=282828&blur=3&fallback=' + fallback_poster + ')');
|
||||
$('#stats-background-' + stat_id).css('background-image', 'url(' + pms_image_proxy(art, rating_key, 500, 280, 40, '282828', 3, fallback_art) + ')');
|
||||
$('#stats-thumb-' + stat_id).css('background-image', 'url(' + pms_image_proxy(thumb, rating_key, 300, height, null, null, null, fallback_poster) + ')');
|
||||
$('#stats-thumb-' + stat_id + '-bg').css('background-image', 'url(' + pms_image_proxy(thumb, rating_key, 300, height, 60, '282828', 3, fallback_poster) + ')');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue