From bee3e39c747672fcc69dfc0adac7c041ed861efe Mon Sep 17 00:00:00 2001 From: Slendy Date: Wed, 31 May 2023 20:45:52 -0500 Subject: [PATCH] Separate user and icon query in GameUserSlot --- ProjectLighthouse/Types/Serialization/GameUserSlot.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ProjectLighthouse/Types/Serialization/GameUserSlot.cs b/ProjectLighthouse/Types/Serialization/GameUserSlot.cs index 4d707f81..5b95ba20 100644 --- a/ProjectLighthouse/Types/Serialization/GameUserSlot.cs +++ b/ProjectLighthouse/Types/Serialization/GameUserSlot.cs @@ -245,16 +245,13 @@ public class GameUserSlot : SlotBase, INeedsPreparationForSerialization PhotoCount = database.Photos.Count(p => p.SlotId == this.SlotId), AuthorPhotoCount = database.Photos.Count(p => p.SlotId == this.SlotId && p.CreatorId == this.CreatorId), HeartCount = database.HeartedLevels.Count(h => h.SlotId == this.SlotId), - UsernameAndIcon = database.Users.Where(u => u.UserId == this.CreatorId).Select(u => new - { - u.Username, - u.IconHash, - }).First(), + Username = database.Users.Where(u => u.UserId == this.CreatorId).Select(u => u.Username).First(), + IconHash = database.Users.Where(u => u.UserId == this.CreatorId).Select(u => u.Username).First(), }) .OrderBy(_ => 1) .FirstAsync(); ReflectionHelper.CopyAllFields(stats, this); - this.AuthorHandle = new NpHandle(stats.UsernameAndIcon.Username, stats.UsernameAndIcon.IconHash); + this.AuthorHandle = new NpHandle(stats.Username, stats.IconHash); if (this.GameVersion == GameVersion.LittleBigPlanet1) {