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

View file

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