mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-06 05:01:14 -07:00
Bump cloudinary from 1.32.0 to 1.34.0 (#2109)
* Bump cloudinary from 1.32.0 to 1.34.0 Bumps [cloudinary](https://github.com/cloudinary/pycloudinary) from 1.32.0 to 1.34.0. - [Release notes](https://github.com/cloudinary/pycloudinary/releases) - [Changelog](https://github.com/cloudinary/pycloudinary/blob/master/CHANGELOG.md) - [Commits](https://github.com/cloudinary/pycloudinary/compare/1.32.0...1.34.0) --- updated-dependencies: - dependency-name: cloudinary dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Update cloudinary==1.34.0 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> [skip ci]
This commit is contained in:
parent
edd8c5fdc3
commit
7266a60343
7 changed files with 167 additions and 29 deletions
|
@ -92,6 +92,7 @@ __SIMPLE_UPLOAD_PARAMS = [
|
|||
"eager_notification_url",
|
||||
"eager_async",
|
||||
"eval",
|
||||
"on_success",
|
||||
"proxy",
|
||||
"folder",
|
||||
"asset_folder",
|
||||
|
@ -106,6 +107,7 @@ __SIMPLE_UPLOAD_PARAMS = [
|
|||
"categorization",
|
||||
"detection",
|
||||
"similarity_search",
|
||||
"visual_search",
|
||||
"background_removal",
|
||||
"upload_preset",
|
||||
"phash",
|
||||
|
@ -281,7 +283,7 @@ def encode_context(context):
|
|||
return "|".join(("{}={}".format(k, normalize_context_value(v))) for k, v in iteritems(context))
|
||||
|
||||
|
||||
def json_encode(value):
|
||||
def json_encode(value, sort_keys=False):
|
||||
"""
|
||||
Converts value to a json encoded string
|
||||
|
||||
|
@ -289,7 +291,7 @@ def json_encode(value):
|
|||
|
||||
:return: JSON encoded string
|
||||
"""
|
||||
return json.dumps(value, default=__json_serializer, separators=(',', ':'))
|
||||
return json.dumps(value, default=__json_serializer, separators=(',', ':'), sort_keys=sort_keys)
|
||||
|
||||
|
||||
def encode_date_to_usage_api_format(date_obj):
|
||||
|
@ -373,8 +375,17 @@ def generate_transformation_string(**options):
|
|||
flags = ".".join(build_array(options.pop("flags", None)))
|
||||
dpr = options.pop("dpr", cloudinary.config().dpr)
|
||||
duration = norm_range_value(options.pop("duration", None))
|
||||
start_offset = norm_auto_range_value(options.pop("start_offset", None))
|
||||
end_offset = norm_range_value(options.pop("end_offset", None))
|
||||
|
||||
so_raw = options.pop("start_offset", None)
|
||||
start_offset = norm_auto_range_value(so_raw)
|
||||
if start_offset == None:
|
||||
start_offset = so_raw
|
||||
|
||||
eo_raw = options.pop("end_offset", None)
|
||||
end_offset = norm_range_value(eo_raw)
|
||||
if end_offset == None:
|
||||
end_offset = eo_raw
|
||||
|
||||
offset = split_range(options.pop("offset", None))
|
||||
if offset:
|
||||
start_offset = norm_auto_range_value(offset[0])
|
||||
|
@ -700,6 +711,25 @@ def unsigned_download_url_prefix(source, cloud_name, private_cdn, cdn_subdomain,
|
|||
return prefix
|
||||
|
||||
|
||||
def build_distribution_domain(options):
|
||||
source = options.pop('source', '')
|
||||
cloud_name = options.pop("cloud_name", cloudinary.config().cloud_name or None)
|
||||
if cloud_name is None:
|
||||
raise ValueError("Must supply cloud_name in tag or in configuration")
|
||||
secure = options.pop("secure", cloudinary.config().secure)
|
||||
private_cdn = options.pop("private_cdn", cloudinary.config().private_cdn)
|
||||
cname = options.pop("cname", cloudinary.config().cname)
|
||||
secure_distribution = options.pop("secure_distribution",
|
||||
cloudinary.config().secure_distribution)
|
||||
cdn_subdomain = options.pop("cdn_subdomain", cloudinary.config().cdn_subdomain)
|
||||
secure_cdn_subdomain = options.pop("secure_cdn_subdomain",
|
||||
cloudinary.config().secure_cdn_subdomain)
|
||||
|
||||
return unsigned_download_url_prefix(
|
||||
source, cloud_name, private_cdn, cdn_subdomain, secure_cdn_subdomain,
|
||||
cname, secure, secure_distribution)
|
||||
|
||||
|
||||
def merge(*dict_args):
|
||||
result = None
|
||||
for dictionary in dict_args:
|
||||
|
@ -728,19 +758,8 @@ def cloudinary_url(source, **options):
|
|||
version = options.pop("version", None)
|
||||
|
||||
format = options.pop("format", None)
|
||||
cdn_subdomain = options.pop("cdn_subdomain", cloudinary.config().cdn_subdomain)
|
||||
secure_cdn_subdomain = options.pop("secure_cdn_subdomain",
|
||||
cloudinary.config().secure_cdn_subdomain)
|
||||
cname = options.pop("cname", cloudinary.config().cname)
|
||||
shorten = options.pop("shorten", cloudinary.config().shorten)
|
||||
|
||||
cloud_name = options.pop("cloud_name", cloudinary.config().cloud_name or None)
|
||||
if cloud_name is None:
|
||||
raise ValueError("Must supply cloud_name in tag or in configuration")
|
||||
secure = options.pop("secure", cloudinary.config().secure)
|
||||
private_cdn = options.pop("private_cdn", cloudinary.config().private_cdn)
|
||||
secure_distribution = options.pop("secure_distribution",
|
||||
cloudinary.config().secure_distribution)
|
||||
sign_url = options.pop("sign_url", cloudinary.config().sign_url)
|
||||
api_secret = options.pop("api_secret", cloudinary.config().api_secret)
|
||||
url_suffix = options.pop("url_suffix", None)
|
||||
|
@ -786,9 +805,9 @@ def cloudinary_url(source, **options):
|
|||
base64.urlsafe_b64encode(
|
||||
hash_fn(to_bytes(to_sign + api_secret)).digest())[0:chars_length]) + "--"
|
||||
|
||||
prefix = unsigned_download_url_prefix(
|
||||
source, cloud_name, private_cdn, cdn_subdomain, secure_cdn_subdomain,
|
||||
cname, secure, secure_distribution)
|
||||
options["source"] = source
|
||||
prefix = build_distribution_domain(options)
|
||||
|
||||
source = "/".join(__compact(
|
||||
[prefix, resource_type, type, signature, transformation, version, source]))
|
||||
if sign_url and auth_token:
|
||||
|
@ -999,6 +1018,7 @@ def archive_params(**options):
|
|||
"skip_transformation_name": options.get("skip_transformation_name"),
|
||||
"tags": options.get("tags") and build_array(options.get("tags")),
|
||||
"target_format": options.get("target_format"),
|
||||
"target_asset_folder": options.get("target_asset_folder"),
|
||||
"target_public_id": options.get("target_public_id"),
|
||||
"target_tags": options.get("target_tags") and build_array(options.get("target_tags")),
|
||||
"timestamp": timestamp,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue