Fixed archive uploading

This commit is contained in:
Pat Hartl 2023-01-14 15:51:41 -06:00
parent 3ae134188e
commit f19a79f6dc
7 changed files with 47 additions and 27 deletions

View file

@ -31,14 +31,18 @@ namespace LANCommander.Controllers
var game = await GameService.Get(id.GetValueOrDefault());
if (game == null)
return NotFound();
Archive lastVersion = null;
if (game.Archives != null && game.Archives.Count > 0)
lastVersion = game.Archives.OrderByDescending(a => a.CreatedOn).FirstOrDefault();
lastVersion = game.Archives.OrderByDescending(a => a.CreatedOn).First();
return View(new Archive()
{
Game = game,
GameId = game.Id,
LastVersion = lastVersion,
});
}
@ -50,7 +54,11 @@ namespace LANCommander.Controllers
var game = await GameService.Get(id.GetValueOrDefault());
if (game == null)
return NotFound();
archive.Game = game;
archive.GameId = game.Id;
if (game.Archives != null && game.Archives.Any(a => a.Version == archive.Version))
ModelState.AddModelError("Version", "An archive for this game is already using that version.");
@ -144,18 +152,25 @@ namespace LANCommander.Controllers
return BadRequest("The manifest file is invalid or corrupt.");
}
var game = await GameService.Get(archive.Game.Id);
var game = await GameService.Get(archive.GameId);
if (game == null)
return BadRequest("The related game is missing or corrupt.");
archive.Game = game;
archive.GameId = game.Id;
archive.Id = Guid.Empty;
archive.CompressedSize = compressedSize;
archive.UncompressedSize = uncompressedSize;
archive.ObjectKey = id.ToString();
archive = await ArchiveService.Update(archive);
try
{
archive = await ArchiveService.Add(archive);
}
catch (Exception ex)
{
}
return Json(new
{

View file

@ -1,5 +1,6 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;
namespace LANCommander.Data.Models
{
@ -12,7 +13,11 @@ namespace LANCommander.Data.Models
[Required]
public string Version { get; set; }
public virtual Game Game { get; set; }
public Guid GameId { get; set; }
[JsonIgnore]
[ForeignKey(nameof(GameId))]
[InverseProperty("Archives")]
public virtual Game? Game { get; set; }
public virtual Archive? LastVersion { get; set; }

View file

@ -29,7 +29,7 @@ namespace LANCommander.Migrations
b.HasIndex("GamesId");
b.ToTable("CategoryGame");
b.ToTable("CategoryGame", (string)null);
});
modelBuilder.Entity("GameDeveloper", b =>
@ -44,7 +44,7 @@ namespace LANCommander.Migrations
b.HasIndex("GameId");
b.ToTable("GameDeveloper");
b.ToTable("GameDeveloper", (string)null);
});
modelBuilder.Entity("GameGenre", b =>
@ -59,7 +59,7 @@ namespace LANCommander.Migrations
b.HasIndex("GenresId");
b.ToTable("GameGenre");
b.ToTable("GameGenre", (string)null);
});
modelBuilder.Entity("GamePublisher", b =>
@ -74,7 +74,7 @@ namespace LANCommander.Migrations
b.HasIndex("PublisherId");
b.ToTable("GamePublisher");
b.ToTable("GamePublisher", (string)null);
});
modelBuilder.Entity("GameTag", b =>
@ -89,7 +89,7 @@ namespace LANCommander.Migrations
b.HasIndex("TagsId");
b.ToTable("GameTag");
b.ToTable("GameTag", (string)null);
});
modelBuilder.Entity("LANCommander.Data.Models.Action", b =>
@ -137,7 +137,7 @@ namespace LANCommander.Migrations
b.HasIndex("UpdatedById");
b.ToTable("Actions");
b.ToTable("Actions", (string)null);
});
modelBuilder.Entity("LANCommander.Data.Models.Archive", b =>
@ -191,7 +191,7 @@ namespace LANCommander.Migrations
b.HasIndex("UpdatedById");
b.ToTable("Archive");
b.ToTable("Archive", (string)null);
});
modelBuilder.Entity("LANCommander.Data.Models.Category", b =>
@ -227,7 +227,7 @@ namespace LANCommander.Migrations
b.HasIndex("UpdatedById");
b.ToTable("Categories");
b.ToTable("Categories", (string)null);
});
modelBuilder.Entity("LANCommander.Data.Models.Company", b =>
@ -258,7 +258,7 @@ namespace LANCommander.Migrations
b.HasIndex("UpdatedById");
b.ToTable("Companies");
b.ToTable("Companies", (string)null);
});
modelBuilder.Entity("LANCommander.Data.Models.Game", b =>
@ -310,7 +310,7 @@ namespace LANCommander.Migrations
b.HasIndex("UpdatedById");
b.ToTable("Games");
b.ToTable("Games", (string)null);
});
modelBuilder.Entity("LANCommander.Data.Models.Genre", b =>
@ -341,7 +341,7 @@ namespace LANCommander.Migrations
b.HasIndex("UpdatedById");
b.ToTable("Genres");
b.ToTable("Genres", (string)null);
});
modelBuilder.Entity("LANCommander.Data.Models.Key", b =>
@ -401,7 +401,7 @@ namespace LANCommander.Migrations
b.HasIndex("UpdatedById");
b.ToTable("Keys");
b.ToTable("Keys", (string)null);
});
modelBuilder.Entity("LANCommander.Data.Models.MultiplayerMode", b =>
@ -452,7 +452,7 @@ namespace LANCommander.Migrations
b.HasIndex("UpdatedById");
b.ToTable("MultiplayerModes");
b.ToTable("MultiplayerModes", (string)null);
});
modelBuilder.Entity("LANCommander.Data.Models.Role", b =>
@ -510,7 +510,7 @@ namespace LANCommander.Migrations
b.HasIndex("UpdatedById");
b.ToTable("Tags");
b.ToTable("Tags", (string)null);
});
modelBuilder.Entity("LANCommander.Data.Models.User", b =>

View file

@ -53,7 +53,7 @@
</div>
</div>
<input type="hidden" asp-for="Game.Id" />
<input type="hidden" asp-for="GameId" />
<input type="hidden" asp-for="LastVersion.Id" />
<input type="hidden" asp-for="ObjectKey" />
</div>

View file

@ -27,7 +27,7 @@ class Uploader {
this.VersionInput = document.getElementById("Version");
this.ChangelogTextArea = document.getElementById("Changelog");
this.LastVersionIdInput = document.getElementById("LastVersion_Id");
this.GameIdInput = document.getElementById("Game_Id");
this.GameIdInput = document.getElementById("GameId");
this.ParentForm = this.FileInput.closest("form");
this.Chunks = [];
this.UploadButton.onclick = (e) => __awaiter(this, void 0, void 0, function* () {
@ -57,7 +57,7 @@ class Uploader {
else
this.OnError();
}
catch (_a) {
catch (ex) {
this.OnError();
}
}
@ -86,7 +86,7 @@ class Uploader {
let formData = new FormData();
formData.append('Version', this.VersionInput.value);
formData.append('Changelog', this.ChangelogTextArea.value);
formData.append('Game.Id', this.GameIdInput.value);
formData.append('GameId', this.GameIdInput.value);
formData.append('ObjectKey', this.Key);
let validationResponse = yield fetch(`${this.ValidateRoute}/${this.Key}`, {
method: "POST",

View file

@ -1 +1 @@
{"version":3,"file":"Upload.js","sourceRoot":"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= document.getElementById("Changelog") as HTMLTextAreaElement;
this.LastVersionIdInput = document.getElementById("LastVersion_Id") as HTMLInputElement;
this.GameIdInput = document.getElementById("Game_Id") as HTMLInputElement;
this.GameIdInput = document.getElementById("GameId") as HTMLInputElement;
this.ParentForm = this.FileInput.closest("form");
this.Chunks = [];
@ -82,7 +82,7 @@ class Uploader {
else
this.OnError();
}
catch {
catch (ex) {
this.OnError();
}
}
@ -115,7 +115,7 @@ class Uploader {
formData.append('Version', this.VersionInput.value);
formData.append('Changelog', this.ChangelogTextArea.value);
formData.append('Game.Id', this.GameIdInput.value);
formData.append('GameId', this.GameIdInput.value);
formData.append('ObjectKey', this.Key);
let validationResponse = await fetch(`${this.ValidateRoute}/${this.Key}`, {