Merge pull request #741 from Hellowlol/cachefix

Allow refresh of images
This commit is contained in:
JonnyWong16 2016-06-04 08:43:51 -07:00
commit 1709a2b7df

View file

@ -3200,7 +3200,9 @@ class WebInterface(object):
@cherrypy.expose @cherrypy.expose
@requireAuth() @requireAuth()
def pms_image_proxy(self, img='', rating_key=None, width='0', height='0', fallback=None, **kwargs): def 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. """
if not img and not rating_key: if not img and not rating_key:
@ -3221,8 +3223,9 @@ class WebInterface(object):
os.mkdir(c_dir) os.mkdir(c_dir)
try: try:
if 'indexes' in img: if not plexpy.CONFIG.CACHE_IMAGES or refresh or 'indexes' in img:
raise NotFound raise NotFound
return serve_file(path=ffp, content_type='image/jpeg') return serve_file(path=ffp, content_type='image/jpeg')
except NotFound: except NotFound: