From 969709898f684b5cdb5566c4cf2eaa688e9eb2eb Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Sun, 28 Jan 2024 17:54:04 +0100 Subject: [PATCH] fix url --- Assets/Scripts/StorageManager.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/StorageManager.cs b/Assets/Scripts/StorageManager.cs index c8bcc6b..ec76fc3 100644 --- a/Assets/Scripts/StorageManager.cs +++ b/Assets/Scripts/StorageManager.cs @@ -42,7 +42,9 @@ public void UploadPhoto(string roomCode, string playerId, int question, int prop byte[] photoBytes = ImageConversion.EncodeToJPG(photo); string imageUuid = Guid.NewGuid().ToString(); - StorageReference imageRef = storage.Child($"gs://ggj2024-5cb41.appspot.com/{roomCode}/{playerId}/{imageUuid}.png"); + string root = "gs://ggj2024-5cb41.appspot.com/"; + string path = $"{roomCode}/{playerId}/{imageUuid}.png"; + StorageReference imageRef = storage.Child(path); imageRef.PutBytesAsync(photoBytes).ContinueWith((Task task) => { @@ -61,7 +63,7 @@ public void UploadPhoto(string roomCode, string playerId, int question, int prop .Child("propositions") .Child(proposition.ToString()) .Child("photoUrl") - .SetValueAsync(imageRef.Path); + .SetValueAsync(root + path); } }); }