aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-12-31 16:43:49 -0600
committerJP Dillingham <jp@dillingham.me>2022-12-31 16:43:49 -0600
commit4e7dd7c421969c05d121ad12e67af7690480957a (patch)
tree6438fd297f186b304f8aded4fe2b20b5d1b7e2b1 /src
parenta9b0a16a9ba7c95044a71cb89b37325011685118 (diff)
downloadslskd-4e7dd7c421969c05d121ad12e67af7690480957a.tar.gz
create directory before downloading
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Relay/RelayClient.cs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/slskd/Relay/RelayClient.cs b/src/slskd/Relay/RelayClient.cs
index bd9d02ac..08ea5e23 100644
--- a/src/slskd/Relay/RelayClient.cs
+++ b/src/slskd/Relay/RelayClient.cs
@@ -428,6 +428,8 @@ namespace slskd.Relay
response.EnsureSuccessStatusCode();
using var remoteStream = await response.Content.ReadAsStreamAsync();
+
+ Directory.CreateDirectory(Path.GetDirectoryName(destinationFile));
using var localStream = new FileStream(destinationFile, FileMode.Create);
await remoteStream.CopyToAsync(localStream);
},