mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 11:53:21 +08:00
Set last online update to actual value provided by data source
This commit is contained in:
parent
17046b0553
commit
07874efa7f
@ -102,13 +102,14 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
beatmapInfo.BeatmapSet.Status = res.BeatmapSet?.Status ?? BeatmapOnlineStatus.None;
|
||||
beatmapInfo.BeatmapSet.OnlineID = res.OnlineBeatmapSetID;
|
||||
|
||||
beatmapInfo.OnlineMD5Hash = res.MD5Hash;
|
||||
beatmapInfo.LastOnlineUpdate = res.LastUpdated;
|
||||
|
||||
beatmapInfo.OnlineID = res.OnlineID;
|
||||
|
||||
beatmapInfo.Metadata.Author.OnlineID = res.AuthorID;
|
||||
|
||||
beatmapInfo.LastOnlineUpdate = DateTimeOffset.Now;
|
||||
|
||||
logForModel(set, $"Online retrieval mapped {beatmapInfo} to {res.OnlineBeatmapSetID} / {res.OnlineID}.");
|
||||
}
|
||||
}
|
||||
@ -193,7 +194,7 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
using (var cmd = db.CreateCommand())
|
||||
{
|
||||
cmd.CommandText = "SELECT beatmapset_id, beatmap_id, approved, user_id, checksum FROM osu_beatmaps WHERE checksum = @MD5Hash OR beatmap_id = @OnlineID OR filename = @Path";
|
||||
cmd.CommandText = "SELECT beatmapset_id, beatmap_id, approved, user_id, checksum, last_update FROM osu_beatmaps WHERE checksum = @MD5Hash OR beatmap_id = @OnlineID OR filename = @Path";
|
||||
|
||||
cmd.Parameters.Add(new SqliteParameter("@MD5Hash", beatmapInfo.MD5Hash));
|
||||
cmd.Parameters.Add(new SqliteParameter("@OnlineID", beatmapInfo.OnlineID));
|
||||
@ -213,7 +214,9 @@ namespace osu.Game.Beatmaps
|
||||
beatmapInfo.BeatmapSet.OnlineID = reader.GetInt32(0);
|
||||
beatmapInfo.OnlineID = reader.GetInt32(1);
|
||||
beatmapInfo.Metadata.Author.OnlineID = reader.GetInt32(3);
|
||||
|
||||
beatmapInfo.OnlineMD5Hash = reader.GetString(4);
|
||||
beatmapInfo.LastOnlineUpdate = reader.GetDateTimeOffset(5);
|
||||
|
||||
logForModel(set, $"Cached local retrieval for {beatmapInfo}.");
|
||||
return true;
|
||||
|
@ -81,6 +81,9 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
[JsonProperty(@"max_combo")]
|
||||
public int? MaxCombo { get; set; }
|
||||
|
||||
[JsonProperty(@"last_updated")]
|
||||
public DateTimeOffset LastUpdated { get; set; }
|
||||
|
||||
public double BPM { get; set; }
|
||||
|
||||
#region Implementation of IBeatmapInfo
|
||||
|
Loading…
Reference in New Issue
Block a user