mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 15:33:21 +08:00
Merge pull request #19530 from peppy/store-modified-time
Add `BeatmapInfo.LastUpdate` to track the time of local changes
This commit is contained in:
commit
e689d4be96
@ -102,6 +102,14 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
public string OnlineMD5Hash { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The last time of a local modification (via the editor).
|
||||
/// </summary>
|
||||
public DateTimeOffset? LastLocalUpdate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The last time online metadata was applied to this beatmap.
|
||||
/// </summary>
|
||||
public DateTimeOffset? LastOnlineUpdate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
@ -94,6 +94,7 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
var beatmapSet = new BeatmapSetInfo
|
||||
{
|
||||
DateAdded = DateTimeOffset.UtcNow,
|
||||
Beatmaps =
|
||||
{
|
||||
new BeatmapInfo(ruleset, new BeatmapDifficulty(), metadata)
|
||||
@ -313,6 +314,7 @@ namespace osu.Game.Beatmaps
|
||||
beatmapInfo.MD5Hash = stream.ComputeMD5Hash();
|
||||
beatmapInfo.Hash = stream.ComputeSHA2Hash();
|
||||
|
||||
beatmapInfo.LastLocalUpdate = DateTimeOffset.Now;
|
||||
beatmapInfo.Status = BeatmapOnlineStatus.LocallyModified;
|
||||
|
||||
AddFile(setInfo, stream, createBeatmapFilenameFromMetadata(beatmapInfo));
|
||||
|
@ -68,8 +68,9 @@ namespace osu.Game.Database
|
||||
/// 20 2022-07-21 Added LastAppliedDifficultyVersion to RulesetInfo, changed default value of BeatmapInfo.StarRating to -1.
|
||||
/// 21 2022-07-27 Migrate collections to realm (BeatmapCollection).
|
||||
/// 22 2022-07-31 Added ModPreset.
|
||||
/// 23 2022-08-01 Added LastLocalUpdate to BeatmapInfo.
|
||||
/// </summary>
|
||||
private const int schema_version = 22;
|
||||
private const int schema_version = 23;
|
||||
|
||||
/// <summary>
|
||||
/// Lock object which is held during <see cref="BlockAllOperations"/> sections, blocking realm retrieval during blocking periods.
|
||||
|
Loading…
Reference in New Issue
Block a user