From 991b3f7af9335fddd4cae823754f254938f8507c Mon Sep 17 00:00:00 2001 From: Slendy Date: Tue, 5 Sep 2023 23:46:19 -0500 Subject: [PATCH] Set PhotoId in serialized event response --- .../Serialization/Activity/Events/GamePhotoUploadEvent.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ProjectLighthouse/Types/Serialization/Activity/Events/GamePhotoUploadEvent.cs b/ProjectLighthouse/Types/Serialization/Activity/Events/GamePhotoUploadEvent.cs index fa839555..c2da06ed 100644 --- a/ProjectLighthouse/Types/Serialization/Activity/Events/GamePhotoUploadEvent.cs +++ b/ProjectLighthouse/Types/Serialization/Activity/Events/GamePhotoUploadEvent.cs @@ -6,6 +6,7 @@ using System.Xml.Serialization; using LBPUnion.ProjectLighthouse.Database; using LBPUnion.ProjectLighthouse.Types.Entities.Level; using LBPUnion.ProjectLighthouse.Types.Entities.Profile; +using LBPUnion.ProjectLighthouse.Types.Levels; using LBPUnion.ProjectLighthouse.Types.Serialization.Review; using Microsoft.EntityFrameworkCore; @@ -34,12 +35,13 @@ public class GamePhotoUploadEvent : GameEvent if (photo == null) return; this.PhotoParticipants = photo.PhotoSubjects.Select(ps => ps.User.Username).ToList(); + this.PhotoId = photo.PhotoId; if (photo.SlotId == null) return; SlotEntity slot = await database.Slots.FindAsync(photo.SlotId); if (slot == null) return; - this.Slot = ReviewSlot.CreateFromEntity(slot); + if (slot.Type == SlotType.User) this.Slot = ReviewSlot.CreateFromEntity(slot); } } \ No newline at end of file