From 433c3e9d54aaf97d730a4a49679788ac5bd702d8 Mon Sep 17 00:00:00 2001 From: Constantine Nathanson <35217733+const-cloudinary@users.noreply.github.com> Date: Wed, 12 Feb 2025 12:58:29 +0200 Subject: [PATCH] Fix `sync` command in dynamic folder mode --- cloudinary_cli/utils/api_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cloudinary_cli/utils/api_utils.py b/cloudinary_cli/utils/api_utils.py index 802164d..38a1ae3 100644 --- a/cloudinary_cli/utils/api_utils.py +++ b/cloudinary_cli/utils/api_utils.py @@ -25,9 +25,10 @@ def query_cld_folder(folder, folder_mode): files = {} folder = folder.strip('/') # omit redundant leading slash and duplicate trailing slashes in query + folder_key = "asset_folder" if folder_mode == "dynamic" else "folder" folder_query = f"{folder}/*" if folder else "*" - expression = Search().expression(f"folder:\"{folder_query}\"").with_field("image_analysis").max_results(500) + expression = Search().expression(f"{folder_key}:\"{folder_query}\"").with_field("image_analysis").max_results(500) next_cursor = True while next_cursor: