From 8e096052ce09149d2517a0225c725a8f809924b0 Mon Sep 17 00:00:00 2001 From: Slendy Date: Mon, 10 Apr 2023 20:53:32 -0500 Subject: [PATCH] Fix duplicate photos on in-game profiles --- ProjectLighthouse/Types/Serialization/GamePhoto.cs | 11 +++++++---- ProjectLighthouse/Types/Serialization/GameReview.cs | 1 - 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ProjectLighthouse/Types/Serialization/GamePhoto.cs b/ProjectLighthouse/Types/Serialization/GamePhoto.cs index c5e66d3a..f8ac7a44 100644 --- a/ProjectLighthouse/Types/Serialization/GamePhoto.cs +++ b/ProjectLighthouse/Types/Serialization/GamePhoto.cs @@ -62,12 +62,15 @@ public class GamePhoto : ILbpSerializable, INeedsPreparationForSerialization }) .FirstOrDefaultAsync(); - if (partialSlot != null) + // Don't send level info if it's not a user or developer slot + if (partialSlot?.Type is not (SlotType.Developer or SlotType.User)) + { + this.LevelInfo = null; + } + else { this.LevelInfo.SlotType = partialSlot.Type; - - if (partialSlot.Type == SlotType.Developer) - this.LevelInfo.SlotId = partialSlot.InternalSlotId; + if (partialSlot.Type == SlotType.Developer) this.LevelInfo.SlotId = partialSlot.InternalSlotId; } // Fetch creator username diff --git a/ProjectLighthouse/Types/Serialization/GameReview.cs b/ProjectLighthouse/Types/Serialization/GameReview.cs index fedacc39..7dba385e 100644 --- a/ProjectLighthouse/Types/Serialization/GameReview.cs +++ b/ProjectLighthouse/Types/Serialization/GameReview.cs @@ -3,7 +3,6 @@ using System.Linq; using System.Threading.Tasks; using System.Xml.Serialization; using LBPUnion.ProjectLighthouse.Database; -using LBPUnion.ProjectLighthouse.Serialization; using LBPUnion.ProjectLighthouse.Types.Entities.Level; using LBPUnion.ProjectLighthouse.Types.Entities.Token; using LBPUnion.ProjectLighthouse.Types.Levels;