Update pms_image_proxy with helper function and encode URL params

This commit is contained in:
JonnyWong16 2020-02-19 19:57:56 -08:00
commit d752d46676
14 changed files with 136 additions and 64 deletions

View file

@ -31,6 +31,9 @@ DOCUMENTATION :: END
</%doc>
% if data:
<%
from plexpy.helpers import pms_image_proxy
%>
<div class="dashboard-recent-media-row">
<div id="recently-added-row-scroller" style="left: 0;">
<ul class="dashboard-recent-media list-unstyled">
@ -45,12 +48,12 @@ DOCUMENTATION :: END
<div class="dashboard-recent-media-poster">
% if item['media_type'] == 'episode':
% if item['parent_thumb']:
<div class="dashboard-recent-media-poster-face" style="background-image: url(pms_image_proxy?img=${item['parent_thumb']}&rating_key=${item['parent_rating_key']}&width=300&height=450&fallback=poster);">
<div class="dashboard-recent-media-poster-face" style="background-image: url(${pms_image_proxy(item['parent_thumb'], item['parent_rating_key'], 300, 450, fallback='poster')});">
% else:
<div class="dashboard-recent-media-poster-face" style="background-image: url(pms_image_proxy?img=${item['grandparent_thumb']}&rating_key=${item['grandparent_rating_key']}&width=300&height=450&fallback=poster);">
<div class="dashboard-recent-media-poster-face" style="background-image: url(${pms_image_proxy(item['grandparent_thumb'], item['grandparent_rating_key'], 300, 450, fallback='poster')});">
% endif
% elif item['media_type'] == 'movie':
<div class="dashboard-recent-media-poster-face" style="background-image: url(pms_image_proxy?img=${item['thumb']}&rating_key=${item['rating_key']}&width=300&height=450&fallback=poster);">
<div class="dashboard-recent-media-poster-face" style="background-image: url(${pms_image_proxy(item['thumb'], item['rating_key'], 300, 450, fallback='poster')});">
% endif
<div class="dashboard-recent-media-overlay">
<div class="dashboard-recent-media-overlay-text" id="added_at-${item['rating_key']}">
@ -88,7 +91,7 @@ DOCUMENTATION :: END
% elif item['media_type'] == 'album':
<a href="info?rating_key=${item['rating_key']}" title="${item['title']}">
<div class="dashboard-recent-media-cover">
<div class="dashboard-recent-media-cover-face" style="background-image: url(pms_image_proxy?img=${item['thumb']}&rating_key=${item['rating_key']}&width=300&height=300&fallback=cover);">
<div class="dashboard-recent-media-cover-face" style="background-image: url(${pms_image_proxy(item['thumb'], item['rating_key'], 300, 300, fallback='cover')});">
<div class="dashboard-recent-media-overlay">
<div class="dashboard-recent-media-overlay-text" id="added_at-${item['rating_key']}">
<script>