Skip to content

Commit

Permalink
Fix filters not being mapped over when creating new maps
Browse files Browse the repository at this point in the history
  • Loading branch information
flustix committed Jul 3, 2024
1 parent 3517194 commit 34ae348
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions fluXis.Game/Database/RealmObjectUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using fluXis.Game.Database.Input;
using fluXis.Game.Database.Maps;
using fluXis.Game.Database.Score;
using fluXis.Shared.Utils;
using osu.Framework.Logging;
using Realms;

Expand All @@ -18,13 +17,7 @@ public static class RealmObjectUtils
c.ShouldMapProperty = pi => pi.SetMethod?.IsPublic == true;
Logger.LogPrint("Creating write mapper", LoggingTarget.Database, LogLevel.Debug);
c.CreateMap<RealmMapMetadata, RealmMapMetadata>().AfterMap((s, d) =>
{
Logger.LogPrint("Mapped metadata", LoggingTarget.Database, LogLevel.Debug);
Logger.Log(s.Serialize(), LoggingTarget.Database, LogLevel.Debug);
Logger.Log(d.Serialize(), LoggingTarget.Database, LogLevel.Debug);
});
c.CreateMap<RealmMapMetadata, RealmMapMetadata>();
c.CreateMap<RealmMapFilters, RealmMapFilters>();
c.CreateMap<RealmMap, RealmMap>()
.ForMember(s => s.Metadata, cc => cc.Ignore())
Expand Down Expand Up @@ -56,6 +49,8 @@ public static class RealmObjectUtils
var newMap = new RealmMap()
{
ID = map.ID,
Metadata = new RealmMapMetadata(),
Filters = new RealmMapFilters(),
MapSet = d
};
Expand Down

0 comments on commit 34ae348

Please sign in to comment.