Fix broken merge

This commit is contained in:
Slendy 2023-08-27 00:30:21 -05:00
commit 7533ae5e89
No known key found for this signature in database
GPG key ID: 7288D68361B91428
3 changed files with 6 additions and 9 deletions

View file

@ -82,7 +82,7 @@ public static class ActivityQueryExtensions
: a is PhotoActivityEntity && ((PhotoActivityEntity)a).Photo.PhotoId != 0 : a is PhotoActivityEntity && ((PhotoActivityEntity)a).Photo.PhotoId != 0
? ((PhotoActivityEntity)a).Photo.SlotId ? ((PhotoActivityEntity)a).Photo.SlotId
: a is CommentActivityEntity && ((CommentActivityEntity)a).Comment.Type == CommentType.Level : a is CommentActivityEntity && ((CommentActivityEntity)a).Comment.Type == CommentType.Level
? ((CommentActivityEntity)a).Comment.TargetId ? ((CommentActivityEntity)a).Comment.TargetSlotId
: a is ScoreActivityEntity : a is ScoreActivityEntity
? ((ScoreActivityEntity)a).Score.SlotId ? ((ScoreActivityEntity)a).Score.SlotId
: a is ReviewActivityEntity : a is ReviewActivityEntity
@ -92,7 +92,7 @@ public static class ActivityQueryExtensions
TargetUserId = a is UserActivityEntity TargetUserId = a is UserActivityEntity
? ((UserActivityEntity)a).TargetUserId ? ((UserActivityEntity)a).TargetUserId
: a is CommentActivityEntity && ((CommentActivityEntity)a).Comment.Type == CommentType.Profile : a is CommentActivityEntity && ((CommentActivityEntity)a).Comment.Type == CommentType.Profile
? ((CommentActivityEntity)a).Comment.TargetId ? ((CommentActivityEntity)a).Comment.TargetUserId
: a is PhotoActivityEntity && ((PhotoActivityEntity)a).Photo.SlotId != 0 : a is PhotoActivityEntity && ((PhotoActivityEntity)a).Photo.SlotId != 0
? ((PhotoActivityEntity)a).Photo.CreatorId ? ((PhotoActivityEntity)a).Photo.CreatorId
: 0, : 0,
@ -109,7 +109,7 @@ public static class ActivityQueryExtensions
: a is PhotoActivityEntity && ((PhotoActivityEntity)a).Photo.SlotId != 0 : a is PhotoActivityEntity && ((PhotoActivityEntity)a).Photo.SlotId != 0
? ((PhotoActivityEntity)a).Photo.Slot!.CreatorId ? ((PhotoActivityEntity)a).Photo.Slot!.CreatorId
: a is CommentActivityEntity && ((CommentActivityEntity)a).Comment.Type == CommentType.Level : a is CommentActivityEntity && ((CommentActivityEntity)a).Comment.Type == CommentType.Level
? ((CommentActivityEntity)a).Comment.TargetId ? ((CommentActivityEntity)a).Comment.TargetSlot.CreatorId
: a is ScoreActivityEntity : a is ScoreActivityEntity
? ((ScoreActivityEntity)a).Score.Slot.CreatorId ? ((ScoreActivityEntity)a).Score.Slot.CreatorId
: a is ReviewActivityEntity : a is ReviewActivityEntity

View file

@ -1,8 +1,6 @@
#nullable enable #nullable enable
using System; using System;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq; using System.Linq;
using System.Reflection;
using LBPUnion.ProjectLighthouse.Database; using LBPUnion.ProjectLighthouse.Database;
using LBPUnion.ProjectLighthouse.Types.Entities.Activity; using LBPUnion.ProjectLighthouse.Types.Entities.Activity;
using LBPUnion.ProjectLighthouse.Types.Entities.Interaction; using LBPUnion.ProjectLighthouse.Types.Entities.Interaction;
@ -44,8 +42,7 @@ public class ActivityEntityEventHandler : IEntityEventHandler
{ {
Type = EventType.Score, Type = EventType.Score,
ScoreId = score.ScoreId, ScoreId = score.ScoreId,
//TODO merge score migration UserId = score.UserId,
UserId = database.Users.Where(u => u.Username == score.PlayerIds[0]).Select(u => u.UserId).First(),
}, },
HeartedLevelEntity heartedLevel => new LevelActivityEntity HeartedLevelEntity heartedLevel => new LevelActivityEntity
{ {

View file

@ -27,7 +27,7 @@ public class GameUserCommentEvent : GameCommentEvent
CommentEntity comment = await database.Comments.FindAsync(this.CommentId); CommentEntity comment = await database.Comments.FindAsync(this.CommentId);
if (comment == null) return; if (comment == null) return;
UserEntity user = await database.Users.FindAsync(comment.TargetId); UserEntity user = await database.Users.FindAsync(comment.TargetUserId);
if (user == null) return; if (user == null) return;
this.TargetUsername = user.Username; this.TargetUsername = user.Username;
@ -46,7 +46,7 @@ public class GameSlotCommentEvent : GameCommentEvent
CommentEntity comment = await database.Comments.FindAsync(this.CommentId); CommentEntity comment = await database.Comments.FindAsync(this.CommentId);
if (comment == null) return; if (comment == null) return;
SlotEntity slot = await database.Slots.FindAsync(comment.TargetId); SlotEntity slot = await database.Slots.FindAsync(comment.TargetSlotId);
if (slot == null) return; if (slot == null) return;