1
0
mirror of synced 2025-02-17 11:18:32 +01:00
This commit is contained in:
asesidaa 2022-10-27 00:42:41 +08:00
parent e55230dc91
commit a5d2db22cc
16 changed files with 56 additions and 59 deletions

View File

@ -26,6 +26,7 @@ namespace GameDatabase.Context
{
return;
}
var path = Path.Combine(PathHelper.GetRootPath(), "taiko.db3");
optionsBuilder.UseSqlite($"Data Source={path}");
}

View File

@ -32,8 +32,8 @@ public partial class TaikoDbContext
entity.HasOne(d => d.Parent)
.WithMany(p => p.DanStageScoreData)
.HasPrincipalKey(p => new {p.Baid, p.DanId})
.HasForeignKey(d => new {d.Baid, d.DanId})
.HasPrincipalKey(p => new { p.Baid, p.DanId })
.HasForeignKey(d => new { d.Baid, d.DanId })
.OnDelete(DeleteBehavior.Cascade);
});
@ -55,8 +55,8 @@ public partial class TaikoDbContext
entity.HasOne(d => d.Parent)
.WithMany(p => p.AiSectionScoreData)
.HasPrincipalKey(p => new {p.Baid, p.SongId, p.Difficulty })
.HasForeignKey(d => new {d.Baid, d.SongId, d.Difficulty })
.HasPrincipalKey(p => new { p.Baid, p.SongId, p.Difficulty })
.HasForeignKey(d => new { d.Baid, d.SongId, d.Difficulty })
.OnDelete(DeleteBehavior.Cascade);
});
}

View File

@ -10,7 +10,8 @@ public class DateTimeConverter : JsonConverter<DateTime>
public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
Debug.Assert(typeToConvert == typeof(DateTime));
var dateTime = DateTime.ParseExact(reader.GetString() ?? string.Empty, "dd_MM_yy-HH_mm_ss", CultureInfo.InvariantCulture);
var dateTime = DateTime.ParseExact(reader.GetString() ?? string.Empty, "dd_MM_yy-HH_mm_ss",
CultureInfo.InvariantCulture);
return dateTime;
}

View File

@ -4,6 +4,5 @@ namespace LocalSaveModScoreMigrator;
public class MusicInfo
{
[JsonPropertyName("items")]
public List<MusicInfoEntry> Items { get; set; } = new();
[JsonPropertyName("items")] public List<MusicInfoEntry> Items { get; set; } = new();
}

View File

@ -4,9 +4,7 @@ namespace LocalSaveModScoreMigrator;
public class MusicInfoEntry
{
[JsonPropertyName("id")]
public string Id { get; set; } = string.Empty;
[JsonPropertyName("id")] public string Id { get; set; } = string.Empty;
[JsonPropertyName("uniqueId")]
public uint SongId { get; set; }
[JsonPropertyName("uniqueId")] public uint SongId { get; set; }
}

View File

@ -8,13 +8,11 @@ public class PlayRecordJson
public string SongId { get; set; } = "tmap4";
public Difficulty Difficulty { get; set; }
[JsonPropertyName("dateTime")]
public DateTime DateTime { get; set; }
[JsonPropertyName("dateTime")] public DateTime DateTime { get; set; }
public uint Score { set; get; }
public CrownType Crown { get; set; }
[JsonPropertyName("scorerank")]
public ScoreRank Scorerank { get; set; }
[JsonPropertyName("scorerank")] public ScoreRank Scorerank { get; set; }
public uint Good { get; set; }
public uint Ok { get; set; }
public uint Bad { get; set; }