diff --git a/LANCommander/Controllers/UploadController.cs b/LANCommander/Controllers/UploadController.cs
index e8dddf8..0ea8d73 100644
--- a/LANCommander/Controllers/UploadController.cs
+++ b/LANCommander/Controllers/UploadController.cs
@@ -19,6 +19,8 @@ namespace LANCommander.Controllers
if (!System.IO.File.Exists(Path.Combine(UploadDirectory, key)))
System.IO.File.Create(Path.Combine(UploadDirectory, key)).Close();
+ else
+ System.IO.File.Delete(Path.Combine(UploadDirectory, key));
return Json(new
{
diff --git a/LANCommander/Pages/Games/Components/ArchiveEditor.razor b/LANCommander/Pages/Games/Components/ArchiveEditor.razor
new file mode 100644
index 0000000..5837c66
--- /dev/null
+++ b/LANCommander/Pages/Games/Components/ArchiveEditor.razor
@@ -0,0 +1,113 @@
+@using System.Net;
+@using System.Diagnostics;
+@using Hangfire;
+@using LANCommander.Jobs.Background;
+@using Microsoft.EntityFrameworkCore;
+@inject HttpClient HttpClient
+@inject NavigationManager Navigator
+@inject ArchiveService ArchiveService
+@inject IMessageService MessageService
+@inject IJSRuntime JS
+
+
+
+
+
+
+ @ByteSizeLib.ByteSize.FromBytes(context.CompressedSize)
+
+
+ @context.CreatedBy?.UserName
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @code {
+ [Parameter] public Game Game { get; set; }
+
+ Archive Archive;
+ ArchiveUploader Uploader;
+
+ protected override async Task OnInitializedAsync()
+ {
+ await LoadData();
+
+ HttpClient.BaseAddress = new Uri(Navigator.BaseUri);
+ }
+
+ private async Task LoadData()
+ {
+ Game.Archives = await ArchiveService.Get(a => a.GameId == Game.Id).OrderByDescending(a => a.CreatedOn).ToListAsync();
+
+ if (Game.Archives == null)
+ Game.Archives = new List();
+ }
+
+ private async Task Download(Archive archive)
+ {
+ string url = $"/Download/Game/{archive.Id}";
+
+ await JS.InvokeAsync