Skip to content

Commit 9ce7a56

Browse files
committed
add remove bulk ai tag method
1 parent 955640c commit 9ce7a56

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

lib/imagekitio/client.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ def bulk_tags_remove(file_ids = [], tags = [])
112112
@file.batch_tags_remove(file_ids, tags)
113113
end
114114

115+
def bulk_ai_tags_remove(file_ids = [], ai_tags = [])
116+
@file.batch_ai_tags_remove(file_ids, ai_tags)
117+
end
118+
115119
def phash_distance(first, second)
116120
# Get hamming distance between two phash(image hash) to check
117121
# similarity between images

lib/imagekitio/file.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,19 @@ def stream_file(remote_file_url, &block)
126126

127127
def batch_tags_add(file_ids, tags)
128128
url = "#{constants.BASE_URL}/addTags"
129-
payload = { 'fileIds': file_ids, tags: tags }
129+
payload = { 'fileIds': file_ids, 'tags': tags }
130130
@req_obj.request('post', url, @req_obj.create_headers, payload)
131131
end
132132

133133
def batch_tags_remove(file_ids, tags)
134134
url = "#{constants.BASE_URL}/removeTags"
135-
payload = { 'fileIds': file_ids, tags: tags }
135+
payload = { 'fileIds': file_ids, 'tags': tags }
136+
@req_obj.request('post', url, @req_obj.create_headers, payload)
137+
end
138+
139+
def batch_ai_tags_remove(file_ids, ai_tags)
140+
url = "#{constants.BASE_URL}/removeAITags"
141+
payload = { 'fileIds': file_ids, 'AITags': ai_tags }
136142
@req_obj.request('post', url, @req_obj.create_headers, payload)
137143
end
138144

0 commit comments

Comments
 (0)