mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 17:43:05 +08:00
Standardise HasReplay
implementation (and remove from persisting to realm)
This commit is contained in:
parent
6122d2a525
commit
c8c79d2185
@ -443,7 +443,6 @@ namespace osu.Game.Database
|
||||
TotalScore = score.TotalScore,
|
||||
MaxCombo = score.MaxCombo,
|
||||
Accuracy = score.Accuracy,
|
||||
HasReplay = ((IScoreInfo)score).HasReplay,
|
||||
Date = score.Date,
|
||||
PP = score.PP,
|
||||
Rank = score.Rank,
|
||||
|
@ -59,8 +59,9 @@ namespace osu.Game.Database
|
||||
/// 13 2022-01-13 Final migration of beatmaps and scores to realm (multiple new storage fields).
|
||||
/// 14 2022-03-01 Added BeatmapUserSettings to BeatmapInfo.
|
||||
/// 15 2022-07-13 Added LastPlayed to BeatmapInfo.
|
||||
/// 16 2022-07-15 Removed HasReplay from ScoreInfo.
|
||||
/// </summary>
|
||||
private const int schema_version = 15;
|
||||
private const int schema_version = 16;
|
||||
|
||||
/// <summary>
|
||||
/// Lock object which is held during <see cref="BlockAllOperations"/> sections, blocking realm retrieval during blocking periods.
|
||||
|
@ -129,8 +129,7 @@ namespace osu.Game.Online.API.Requests.Responses
|
||||
Rank = Rank,
|
||||
Statistics = Statistics,
|
||||
Date = EndedAt ?? DateTimeOffset.Now,
|
||||
Hash = "online", // TODO: temporary?
|
||||
HasReplay = HasReplay,
|
||||
Hash = HasReplay ? "online" : string.Empty, // TODO: temporary?
|
||||
Mods = mods,
|
||||
PP = PP,
|
||||
};
|
||||
|
@ -45,7 +45,7 @@ namespace osu.Game.Scoring
|
||||
|
||||
public double Accuracy { get; set; }
|
||||
|
||||
public bool HasReplay { get; set; }
|
||||
public bool HasReplay => !string.IsNullOrEmpty(Hash);
|
||||
|
||||
public DateTimeOffset Date { get; set; }
|
||||
|
||||
|
@ -33,7 +33,7 @@ namespace osu.Game.Screens.Ranking
|
||||
if (State.Value == DownloadState.LocallyAvailable)
|
||||
return ReplayAvailability.Local;
|
||||
|
||||
if (!string.IsNullOrEmpty(Score.Value?.Hash))
|
||||
if (Score.Value?.HasReplay == true)
|
||||
return ReplayAvailability.Online;
|
||||
|
||||
return ReplayAvailability.NotAvailable;
|
||||
|
Loading…
Reference in New Issue
Block a user