mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-08 06:00:51 -07:00
Merge pull request #856 from Hellowlol/imgfix
fix for image proxy for api.
This commit is contained in:
commit
58f72d2d9c
1 changed files with 15 additions and 7 deletions
|
@ -3283,9 +3283,21 @@ class WebInterface(object):
|
||||||
|
|
||||||
@cherrypy.expose
|
@cherrypy.expose
|
||||||
@requireAuth()
|
@requireAuth()
|
||||||
@addtoapi()
|
def pms_image_proxy(self, **kwargs):
|
||||||
def pms_image_proxy(self, img='', rating_key=None, width='0', height='0',
|
""" See real_pms_image_proxy docs string"""
|
||||||
fallback=None, refresh=False, **kwargs):
|
|
||||||
|
refresh = False
|
||||||
|
if kwargs.get('refresh'):
|
||||||
|
mo = member_of('admin')
|
||||||
|
refresh = True if mo() else False
|
||||||
|
|
||||||
|
kwargs['refresh'] = refresh
|
||||||
|
|
||||||
|
return self.real_pms_image_proxy(**kwargs)
|
||||||
|
|
||||||
|
@addtoapi('pms_image_proxy')
|
||||||
|
def real_pms_image_proxy(self, img='', rating_key=None, width='0', height='0',
|
||||||
|
fallback=None, refresh=False, **kwargs):
|
||||||
""" Gets an image from the PMS and saves it to the image cache directory.
|
""" Gets an image from the PMS and saves it to the image cache directory.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -3308,10 +3320,6 @@ class WebInterface(object):
|
||||||
logger.error('No image input received.')
|
logger.error('No image input received.')
|
||||||
return
|
return
|
||||||
|
|
||||||
if refresh:
|
|
||||||
mo = member_of('admin')
|
|
||||||
refresh = True if mo() else False
|
|
||||||
|
|
||||||
if rating_key and not img:
|
if rating_key and not img:
|
||||||
img = '/library/metadata/%s/thumb/1337' % rating_key
|
img = '/library/metadata/%s/thumb/1337' % rating_key
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue