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

View file

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

View file

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