mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Workshop - Added image uploading
This commit is contained in:
1 parent
0667d58ed8
commit
e33ae8a066
9 files changed
+120
-35
No files matched your search
@@ -185,7 +185,7 @@ internal class AuthenticationService : CorePropertyChanged, IAuthenticationServi
|
||||
return;
|
||||
|
||||
// Start a HTTP listener, this port could be in use but chances are very slim
|
||||
string redirectUri = "http://localhost:56789";
|
||||
string redirectUri = "http://localhost:57461";
|
||||
using HttpListener listener = new();
|
||||
listener.Prefixes.Add(redirectUri + "/");
|
||||
listener.Start();
|
||||
|
||||
@@ -69,7 +69,10 @@ public class WorkshopService : IWorkshopService
|
||||
ProgressableStreamContent streamContent = new(request.File, progress);
|
||||
streamContent.Headers.ContentType = new MediaTypeHeaderValue("image/png");
|
||||
content.Add(streamContent, "file", "file.png");
|
||||
|
||||
content.Add(new StringContent(request.Name), "Name");
|
||||
if (request.Description != null)
|
||||
content.Add(new StringContent(request.Description), "Description");
|
||||
|
||||
// Submit
|
||||
HttpResponseMessage response = await client.PostAsync($"entries/{entryId}/image", content, cancellationToken);
|
||||
if (!response.IsSuccessStatusCode)
|
||||
|
||||
Reference in new issue
Block a user