diff --git a/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj b/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj index fdc17caa..cc77d93b 100644 --- a/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj +++ b/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj @@ -13,7 +13,11 @@ - + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/ProjectLighthouse/Controllers/PublishController.cs b/ProjectLighthouse/Controllers/PublishController.cs index b52a02c7..483d4b22 100644 --- a/ProjectLighthouse/Controllers/PublishController.cs +++ b/ProjectLighthouse/Controllers/PublishController.cs @@ -36,6 +36,10 @@ namespace LBPUnion.ProjectLighthouse.Controllers Slot slot = await this.GetSlotFromBody(); if (slot == null) return this.BadRequest(); // if the level cant be parsed then it obviously cant be uploaded + if (string.IsNullOrEmpty(slot.RootLevel)) return this.BadRequest(); + + if (string.IsNullOrEmpty(slot.ResourceCollection)) slot.ResourceCollection = slot.RootLevel; + // Republish logic if (slot.SlotId != 0) { @@ -44,6 +48,8 @@ namespace LBPUnion.ProjectLighthouse.Controllers if (oldSlot.CreatorId != user.UserId) return this.BadRequest(); } + slot.ResourceCollection += "," + slot.IconHash; // tells LBP to upload icon after we process resources here + string resources = slot.Resources.Where (hash => !FileHelper.ResourceExists(hash)) .Aggregate("", (current, hash) => current + LbpSerializer.StringElement("resource", hash)); diff --git a/ProjectLighthouse/ProjectLighthouse.csproj b/ProjectLighthouse/ProjectLighthouse.csproj index 89eb6c44..1b8e4906 100644 --- a/ProjectLighthouse/ProjectLighthouse.csproj +++ b/ProjectLighthouse/ProjectLighthouse.csproj @@ -10,13 +10,13 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - +