From 93a6d8500e3dc5cc8f642d32e6b5cefba8e0d122 Mon Sep 17 00:00:00 2001 From: jvyden Date: Sun, 14 Nov 2021 22:02:35 -0500 Subject: [PATCH] Potential fix for missing icons (#49) --- ProjectLighthouse/Controllers/PublishController.cs | 6 ++++++ 1 file changed, 6 insertions(+) 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));