Fallback pms_image_proxy when no image imput received

This commit is contained in:
JonnyWong16 2020-02-16 20:06:35 -08:00
parent 66a0f953b3
commit 73f8f83658
2 changed files with 5 additions and 2 deletions

View file

@ -80,8 +80,7 @@ DOCUMENTATION :: END
<div class="dashboard-activity-container">
<%
if data['live']:
art = ('img=' + data['art']) if data['art'] else ('rating_key=' + data['rating_key'])
background_url = 'pms_image_proxy?' + art + '&width=500&height=280&opacity=40&background=282828&blur=3&fallback=art-live&refresh=true'
background_url = 'pms_image_proxy?img=' + data['art'] + '&width=500&height=280&opacity=40&background=282828&blur=3&fallback=art-live&refresh=true'
elif data['channel_stream'] == 0:
background_url = 'pms_image_proxy?img=' + data['art'] + '&width=500&height=280&opacity=40&background=282828&blur=3&fallback=art&refresh=true'
else:

View file

@ -4047,6 +4047,10 @@ class WebInterface(object):
```
"""
if not img and not rating_key:
if fallback in common.DEFAULT_IMAGES:
fbi = common.DEFAULT_IMAGES[fallback]
fp = os.path.join(plexpy.PROG_DIR, 'data', fbi)
return serve_file(path=fp, content_type='image/png')
logger.warn('No image input received.')
return