mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-07 13:41:15 -07:00
Add Cloudinary versioning when retrieving the image
This commit is contained in:
parent
8540b80e57
commit
2df9f0b48b
1 changed files with 7 additions and 9 deletions
|
@ -834,7 +834,8 @@ def cloudinary_transform(rating_key=None, width=1000, height=1500, opacity=100,
|
|||
api_secret=plexpy.CONFIG.CLOUDINARY_API_SECRET
|
||||
)
|
||||
|
||||
img_options = {}
|
||||
img_options = {'format': img_format,
|
||||
'version': int(time.time())}
|
||||
|
||||
if width != 1000:
|
||||
img_options['width'] = str(width)
|
||||
|
@ -849,14 +850,11 @@ def cloudinary_transform(rating_key=None, width=1000, height=1500, opacity=100,
|
|||
if blur != 0:
|
||||
img_options['effect'] = 'blur:{}'.format(blur * 100)
|
||||
|
||||
if img_options:
|
||||
img_options['format'] = img_format
|
||||
|
||||
try:
|
||||
url, options = cloudinary_url('{}_{}'.format(fallback, rating_key), **img_options)
|
||||
logger.debug(u"Tautulli Helpers :: Image '{}' ({}) transformed on Cloudinary.".format(img_title, fallback))
|
||||
except Exception as e:
|
||||
logger.error(u"Tautulli Helpers :: Unable to transform image '{}' ({}) on Cloudinary: {}".format(img_title, fallback, e))
|
||||
try:
|
||||
url, options = cloudinary_url('{}_{}'.format(fallback, rating_key), **img_options)
|
||||
logger.debug(u"Tautulli Helpers :: Image '{}' ({}) transformed on Cloudinary.".format(img_title, fallback))
|
||||
except Exception as e:
|
||||
logger.error(u"Tautulli Helpers :: Unable to transform image '{}' ({}) on Cloudinary: {}".format(img_title, fallback, e))
|
||||
|
||||
return url
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue