mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-19 21:03:21 -07:00
Add ability to return svg files using pms_image_proxy
This commit is contained in:
parent
5921a7d83f
commit
d46710962c
2 changed files with 6 additions and 2 deletions
|
@ -675,7 +675,6 @@ General optional parameters:
|
||||||
|
|
||||||
elif self._api_cmd == 'pms_image_proxy':
|
elif self._api_cmd == 'pms_image_proxy':
|
||||||
if 'return_hash' not in self._api_kwargs:
|
if 'return_hash' not in self._api_kwargs:
|
||||||
cherrypy.response.headers['Content-Type'] = 'image/jpeg'
|
|
||||||
return out['response']['data']
|
return out['response']['data']
|
||||||
|
|
||||||
elif self._api_cmd == 'get_geoip_lookup':
|
elif self._api_cmd == 'get_geoip_lookup':
|
||||||
|
|
|
@ -4753,7 +4753,12 @@ class WebInterface(object):
|
||||||
|
|
||||||
if isinstance(img, str) and img.startswith('interfaces/default/images'):
|
if isinstance(img, str) and img.startswith('interfaces/default/images'):
|
||||||
fp = os.path.join(plexpy.PROG_DIR, 'data', img)
|
fp = os.path.join(plexpy.PROG_DIR, 'data', img)
|
||||||
return serve_file(path=fp, content_type='image/png')
|
ext = img.rsplit(".", 1)[-1]
|
||||||
|
if ext == 'svg':
|
||||||
|
content_type = 'image/svg+xml'
|
||||||
|
else:
|
||||||
|
content_type = 'image/{}'.format(ext)
|
||||||
|
return serve_file(path=fp, content_type=content_type)
|
||||||
|
|
||||||
if not img and not rating_key:
|
if not img and not rating_key:
|
||||||
if fallback in common.DEFAULT_IMAGES:
|
if fallback in common.DEFAULT_IMAGES:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue