From 3ca63af9c565803c26e4427f9b9ca0a877be3b49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Santilio?= Date: Sat, 10 Jul 2021 20:35:20 +0200 Subject: [PATCH] complete storage support --- addons/supabase/Storage/storage.gd | 8 +++----- addons/supabase/Storage/storage_bucket.gd | 9 ++++----- file.json | 3 --- 3 files changed, 7 insertions(+), 13 deletions(-) delete mode 100644 file.json diff --git a/addons/supabase/Storage/storage.gd b/addons/supabase/Storage/storage.gd index 08aa7a6..0f6d935 100644 --- a/addons/supabase/Storage/storage.gd +++ b/addons/supabase/Storage/storage.gd @@ -120,11 +120,9 @@ func _on_task_completed(task : StorageTask) -> void: match task._code: task.METHODS.LIST_BUCKETS: emit_signal("listed_buckets", task.data) task.METHODS.GET_BUCKET: emit_signal("got_bucket", task.data) - task.METHODS.CREATE_BUCKET: emit_signal("created_bucket", task.data) - task.METHODS.UPDATE_BUCKET: emit_signal("updated_bucket", task.data) - task.METHODS.EMPTY_BUCKET: emit_signal("emptied_bucket", task.data) + task.METHODS.CREATE_BUCKET: emit_signal("created_bucket", from(task.data.name)) + task.METHODS.UPDATE_BUCKET: emit_signal("updated_bucket", from(task.data.name)) + task.METHODS.EMPTY_BUCKET: emit_signal("emptied_bucket", from(task.data.name)) task.METHODS.DELETE_BUCKET: emit_signal("deleted_bucket", task.data) - _: - emit_signal("rpc_completed", task.data) elif task.error != null: emit_signal("error", task.error) diff --git a/addons/supabase/Storage/storage_bucket.gd b/addons/supabase/Storage/storage_bucket.gd index 064e277..9ac50f5 100644 --- a/addons/supabase/Storage/storage_bucket.gd +++ b/addons/supabase/Storage/storage_bucket.gd @@ -5,16 +5,17 @@ const MIME_TYPES : Dictionary = { "bmp": "image/bmp", "css": "text/css", "csv": "text/csv", - "gd": "text/gdscript", + "gd": "text/plain", "htm": "text/html", "html": "text/html", "jpeg": "image/jpeg", "jpg": "image/jpeg", - "json": "text/json", + "json": "application/json", "mp3": "audio/mpeg", "mpeg": "video/mpeg", "ogg": "audio/ogg", "ogv": "video/ogg", + "pdf": "application/pdf", "png": "image/png", "res": "text/plain", "shader": "text/plain", @@ -23,7 +24,7 @@ const MIME_TYPES : Dictionary = { "tiff": "image/tiff", "tres": "text/plain", "tscn": "text/plain", - "txt": "text/plain", + "txt": "text/script", "wav": "audio/wav", "webm": "video/webm", "webp": "video/webm", @@ -292,8 +293,6 @@ func _on_task_completed(task : StorageTask) -> void: task.METHODS.REMOVE: emit_signal("removed_objects", task.data) task.METHODS.CREATE_SIGNED_URL: emit_signal("created_signed_url", task.data) task.METHODS.DOWNLOAD: emit_signal("downloaded_object", task.data) - _: - emit_signal("rpc_completed", task.data) elif task.error != null: emit_signal("error", task.error) diff --git a/file.json b/file.json deleted file mode 100644 index b06749f..0000000 --- a/file.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "somedata" : "somevalue" -}