Fix duplicate photos on in-game profiles

This commit is contained in:
Slendy 2023-04-10 20:53:32 -05:00
commit 8e096052ce
No known key found for this signature in database
GPG key ID: 7288D68361B91428
2 changed files with 7 additions and 5 deletions

View file

@ -62,12 +62,15 @@ public class GamePhoto : ILbpSerializable, INeedsPreparationForSerialization
}) })
.FirstOrDefaultAsync(); .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; 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 // Fetch creator username

View file

@ -3,7 +3,6 @@ using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Xml.Serialization; using System.Xml.Serialization;
using LBPUnion.ProjectLighthouse.Database; using LBPUnion.ProjectLighthouse.Database;
using LBPUnion.ProjectLighthouse.Serialization;
using LBPUnion.ProjectLighthouse.Types.Entities.Level; using LBPUnion.ProjectLighthouse.Types.Entities.Level;
using LBPUnion.ProjectLighthouse.Types.Entities.Token; using LBPUnion.ProjectLighthouse.Types.Entities.Token;
using LBPUnion.ProjectLighthouse.Types.Levels; using LBPUnion.ProjectLighthouse.Types.Levels;