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));