From 39c969f3a93cfd1af142d215019f47792244d210 Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 5 Aug 2022 12:21:48 -0500 Subject: [PATCH] Include number of photos in slot serialization (#402) * Include number of photos in slot serialization * Fix compilation error Co-authored-by: Jayden --- ProjectLighthouse/Levels/Slot.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ProjectLighthouse/Levels/Slot.cs b/ProjectLighthouse/Levels/Slot.cs index 04a31e32..caf72beb 100644 --- a/ProjectLighthouse/Levels/Slot.cs +++ b/ProjectLighthouse/Levels/Slot.cs @@ -143,6 +143,16 @@ public class Slot [JsonIgnore] public int Comments => this.database.Comments.Count(c => c.Type == CommentType.Level && c.TargetId == this.SlotId); + [XmlIgnore] + [NotMapped] + [JsonIgnore] + public int Photos => this.database.Photos.Count(p => p.SlotId == this.SlotId); + + [XmlIgnore] + [NotMapped] + [JsonIgnore] + public int PhotosWithAuthor => this.database.Photos.Count(p => p.SlotId == this.SlotId && p.CreatorId == this.CreatorId); + [XmlIgnore] [NotMapped] public int Plays => this.PlaysLBP1 + this.PlaysLBP2 + this.PlaysLBP3 + this.PlaysLBPVita; @@ -303,6 +313,8 @@ public class Slot LbpSerializer.StringElement("mmpick", this.TeamPick) + LbpSerializer.StringElement("heartCount", this.Hearts) + LbpSerializer.StringElement("playCount", this.Plays) + + LbpSerializer.StringElement("photoCount", this.Photos) + + LbpSerializer.StringElement("authorPhotoCount", this.PhotosWithAuthor) + LbpSerializer.StringElement("commentCount", this.Comments) + LbpSerializer.StringElement("uniquePlayCount", this.PlaysLBP2Unique) + // ??? good naming scheme lol LbpSerializer.StringElement("completionCount", this.PlaysComplete) +