mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-10-02 14:19:39 +00:00
Fix broken merge
This commit is contained in:
parent
d20b21e98a
commit
7533ae5e89
3 changed files with 6 additions and 9 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue