From d46710962cebc05e257c41454ac8e15d9933828a Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Sun, 3 Aug 2025 09:35:06 -0700 Subject: [PATCH] Add ability to return svg files using pms_image_proxy --- plexpy/api2.py | 1 - plexpy/webserve.py | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/plexpy/api2.py b/plexpy/api2.py index 9cc36b49..b4328f96 100644 --- a/plexpy/api2.py +++ b/plexpy/api2.py @@ -675,7 +675,6 @@ General optional parameters: elif self._api_cmd == 'pms_image_proxy': if 'return_hash' not in self._api_kwargs: - cherrypy.response.headers['Content-Type'] = 'image/jpeg' return out['response']['data'] elif self._api_cmd == 'get_geoip_lookup': diff --git a/plexpy/webserve.py b/plexpy/webserve.py index c402092f..4aa3bd67 100644 --- a/plexpy/webserve.py +++ b/plexpy/webserve.py @@ -4753,7 +4753,12 @@ class WebInterface(object): if isinstance(img, str) and img.startswith('interfaces/default/images'): 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 fallback in common.DEFAULT_IMAGES: