Include number of photos in slot serialization (#402)

* Include number of photos in slot serialization

* Fix compilation error

Co-authored-by: Jayden <jvyden@jvyden.xyz>
This commit is contained in:
Josh 2022-08-05 12:21:48 -05:00 committed by GitHub
commit 39c969f3a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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) +