You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
task.task_finished.emit(task.data) # I believe this parameter has been missing all along, but not sure. Caused weird results at times with a yield/await returning null, but the task containing data.
Copy file name to clipboardExpand all lines: addons/godot-firebase/storage/storage_reference.gd
+34-58
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
## This object is used to interact with the cloud storage. You may get data from the server, as well as upload your own back to it.
5
5
@tool
6
6
class_nameStorageReference
7
-
extendsRefCounted
7
+
extendsNode
8
8
9
9
## The default MIME type to use when uploading a file.
10
10
## Data sent with this type are interpreted as plain binary data. Note that firebase will generate an MIME type based checked the file extenstion if none is provided.
@@ -36,7 +36,7 @@ const MIME_TYPES = {
36
36
"txt": "text/plain",
37
37
"wav": "audio/wav",
38
38
"webm": "video/webm",
39
-
"webp": "video/webm",
39
+
"webp": "image/webp",
40
40
"xml": "text/xml",
41
41
}
42
42
@@ -51,7 +51,7 @@ var full_path : String = ""
51
51
## @default ""
52
52
## The name of the file/folder, including any file extension.
53
53
## Example: If the [member full_path] is [code]images/user/image.png[/code], then the [member name] would be [code]image.png[/code].
54
-
varname : String=""
54
+
varfile_name : String=""
55
55
56
56
## The parent [StorageReference] one level up the file hierarchy.
57
57
## If the current [StorageReference] is the root (i.e. the [member full_path] is [code]""[/code]) then the [member parent] will be [code]null[/code].
@@ -64,116 +64,92 @@ var root : StorageReference
64
64
## The Storage API that created this [StorageReference] to begin with.
65
65
varstorage# FirebaseStorage (Can't static type due to cyclic reference)
66
66
67
-
## @default false
68
-
## Whether this [StorageReference] is valid. None of the functions will work when in an invalid state.
69
-
## It is set to false when [method delete] is called.
70
-
varvalid : bool=false
71
-
72
67
## @args path
73
68
## @return StorageReference
74
69
## Returns a reference to another [StorageReference] relative to this one.
75
70
funcchild(path : String) ->StorageReference:
76
-
ifnotvalid:
77
-
returnnull
78
71
returnstorage.ref(full_path.path_join(path))
79
72
80
73
## @args data, metadata
81
-
## @return StorageTask
82
-
## Makes an attempt to upload data to the referenced file location. Status checked this task is found in the returned [StorageTask].
## Attempts to get the download url that points to the referenced file's data. Using the url directly may require an authentication header. Status checked this task is found in the returned [StorageTask].
130
-
funcget_download_url() ->StorageTask:
131
-
ifnotvalid:
132
-
returnnull
133
-
returnstorage._download(self, false, true)
120
+
funcget_download_url() ->Variant:
121
+
returnawaitstorage._download(self, false, true)
134
122
135
123
## @return StorageTask
136
124
## Attempts to get the metadata of the referenced file. Status checked this task is found in the returned [StorageTask].
137
-
funcget_metadata() ->StorageTask:
138
-
ifnotvalid:
139
-
returnnull
140
-
returnstorage._download(self, true, false)
125
+
funcget_metadata() ->Variant:
126
+
returnawaitstorage._download(self, true, false)
141
127
142
128
## @args metadata
143
129
## @return StorageTask
144
130
## Attempts to update the metadata of the referenced file. Any field with a value of [code]null[/code] will be deleted checked the server end. Status checked this task is found in the returned [StorageTask].
## Attempts to get the list of files and/or folders under the referenced folder This function is not nested unlike [method list_all]. Status checked this task is found in the returned [StorageTask].
154
-
funclist() ->StorageTask:
155
-
ifnotvalid:
156
-
returnnull
157
-
returnstorage._list(self, false)
138
+
funclist() ->Array:
139
+
returnawaitstorage._list(self, false)
158
140
159
141
## @return StorageTask
160
142
## Attempts to get the list of files and/or folders under the referenced folder This function is nested unlike [method list]. Status checked this task is found in the returned [StorageTask].
161
-
funclist_all() ->StorageTask:
162
-
ifnotvalid:
163
-
returnnull
164
-
returnstorage._list(self, true)
143
+
funclist_all() ->Array:
144
+
returnawaitstorage._list(self, true)
165
145
166
146
## @return StorageTask
167
147
## Attempts to delete the referenced file/folder. If successful, the reference will become invalid And can no longer be used. If you need to reference this location again, make a new reference with [method StorageTask.ref]. Status checked this task is found in the returned [StorageTask].
0 commit comments