Update pms_image_proxy to work with web URLs

This commit is contained in:
JonnyWong16 2020-02-15 20:14:50 -08:00
commit 13a45facf9
4 changed files with 30 additions and 44 deletions

View file

@ -2694,10 +2694,14 @@ class PmsConnect(object):
height = height or 1500
if img:
if refresh:
web_img = img.startswith('http')
if refresh and not web_img:
img = '{}/{}'.format(img.rstrip('/'), int(time.time()))
if clip:
if web_img:
params = {'url': '%s' % img}
elif clip:
params = {'url': '%s&%s' % (img, urllib.urlencode({'X-Plex-Token': self.token}))}
else:
params = {'url': 'http://127.0.0.1:32400%s?%s' % (img, urllib.urlencode({'X-Plex-Token': self.token}))}