From 71ab2248d7134b0b782b4455e321aa1cfa98ed7a Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Thu, 3 May 2018 08:34:32 -0700 Subject: [PATCH] Make sure Cloudinary parameters are strings --- plexpy/helpers.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plexpy/helpers.py b/plexpy/helpers.py index 7dcd2471..58d8fdc3 100644 --- a/plexpy/helpers.py +++ b/plexpy/helpers.py @@ -792,8 +792,8 @@ def upload_to_cloudinary(img_data, img_title='', rating_key='', fallback=''): try: response = upload('data:image/png;base64,{}'.format(base64.b64encode(img_data)), public_id='{}_{}'.format(fallback, rating_key), - tags=[fallback, rating_key], - context={'title': img_title, 'rating_key': rating_key, 'fallback': fallback}) + tags=[fallback, str(rating_key)], + context={'title': img_title, 'rating_key': str(rating_key), 'fallback': fallback}) logger.debug(u"Tautulli Helpers :: Image '{}' ({}) uploaded to Cloudinary.".format(img_title, fallback)) img_url = response.get('url', '') except Exception as e: @@ -837,10 +837,10 @@ def cloudinary_transform(rating_key=None, width=1000, height=1500, opacity=100, img_options = {} if width != 1000: - img_options['width'] = width + img_options['width'] = str(width) img_options['crop'] = 'fill' if height != 1500: - img_options['height'] = height + img_options['height'] = str(height) img_options['crop'] = 'fill' if opacity != 100: img_options['opacity'] = opacity