1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 05:32:54 +08:00

Add BeatmapInfo.LastUpdate to track the time of local changes

This commit is contained in:
Dean Herbert 2022-08-02 00:21:28 +09:00
parent 013cf7a80a
commit d7a06abcab
3 changed files with 11 additions and 1 deletions

View File

@ -102,6 +102,14 @@ namespace osu.Game.Beatmaps
public string OnlineMD5Hash { get; set; } = string.Empty; public string OnlineMD5Hash { get; set; } = string.Empty;
/// <summary>
/// The last time of a local modification (via the editor).
/// </summary>
public DateTimeOffset? LastUpdated { get; set; }
/// <summary>
/// The last time online metadata was applied to this beatmap.
/// </summary>
public DateTimeOffset? LastOnlineUpdate { get; set; } public DateTimeOffset? LastOnlineUpdate { get; set; }
/// <summary> /// <summary>

View File

@ -314,6 +314,7 @@ namespace osu.Game.Beatmaps
beatmapInfo.MD5Hash = stream.ComputeMD5Hash(); beatmapInfo.MD5Hash = stream.ComputeMD5Hash();
beatmapInfo.Hash = stream.ComputeSHA2Hash(); beatmapInfo.Hash = stream.ComputeSHA2Hash();
beatmapInfo.Status = BeatmapOnlineStatus.LocallyModified; beatmapInfo.Status = BeatmapOnlineStatus.LocallyModified;
beatmapInfo.LastUpdated = DateTimeOffset.Now;
if (setInfo.Beatmaps.All(b => b.Status == BeatmapOnlineStatus.LocallyModified)) if (setInfo.Beatmaps.All(b => b.Status == BeatmapOnlineStatus.LocallyModified))
setInfo.Status = BeatmapOnlineStatus.LocallyModified; setInfo.Status = BeatmapOnlineStatus.LocallyModified;

View File

@ -67,8 +67,9 @@ namespace osu.Game.Database
/// 20 2022-07-21 Added LastAppliedDifficultyVersion to RulesetInfo, changed default value of BeatmapInfo.StarRating to -1. /// 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). /// 21 2022-07-27 Migrate collections to realm (BeatmapCollection).
/// 22 2022-07-31 Added ModPreset. /// 22 2022-07-31 Added ModPreset.
/// 23 2022-08-01 Added LastUpdated to BeatmapInfo.
/// </summary> /// </summary>
private const int schema_version = 22; private const int schema_version = 23;
/// <summary> /// <summary>
/// Lock object which is held during <see cref="BlockAllOperations"/> sections, blocking realm retrieval during blocking periods. /// Lock object which is held during <see cref="BlockAllOperations"/> sections, blocking realm retrieval during blocking periods.