Potential fix for missing icons (#49)

This commit is contained in:
jvyden 2021-11-14 22:02:35 -05:00
commit 93a6d8500e
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278

View file

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