Merge pull request #856 from Hellowlol/imgfix

fix for image proxy for api.
This commit is contained in:
JonnyWong16 2016-10-02 12:09:33 -07:00 committed by GitHub
commit 58f72d2d9c

View file

@ -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