diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..deca2eb --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "EchoHub"] + path = EchoHub + url = https://github.com/HueByte/EchoHub.git diff --git a/Decho/Decho.csproj b/Decho/Decho.csproj index 831bf40..9880eda 100644 --- a/Decho/Decho.csproj +++ b/Decho/Decho.csproj @@ -34,7 +34,7 @@ - - + + diff --git a/Decho/Services/ConnectionService.cs b/Decho/Services/ConnectionService.cs index 4dc03b4..5434381 100644 --- a/Decho/Services/ConnectionService.cs +++ b/Decho/Services/ConnectionService.cs @@ -388,7 +388,18 @@ public sealed class ConnectionService : IDisposable { if (!_connections.TryGetValue(serverUrl, out var entry)) return null; - return await entry.ApiClient.DownloadBytesAsync(relativeUrl); + try + { + var tempPath = await entry.ApiClient.DownloadFileToTempAsync(relativeUrl, "image"); + if (tempPath is null) return null; + var bytes = await File.ReadAllBytesAsync(tempPath); + try { File.Delete(tempPath); } catch { } + return bytes; + } + catch + { + return null; + } } public string? GetCurrentUsername(string serverUrl) diff --git a/EchoHub b/EchoHub new file mode 160000 index 0000000..3538ec8 --- /dev/null +++ b/EchoHub @@ -0,0 +1 @@ +Subproject commit 3538ec8005fee153b5741b2eab6823365dae8fa9