mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 21:02:54 +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,
|
TotalScore = score.TotalScore,
|
||||||
MaxCombo = score.MaxCombo,
|
MaxCombo = score.MaxCombo,
|
||||||
Accuracy = score.Accuracy,
|
Accuracy = score.Accuracy,
|
||||||
HasReplay = ((IScoreInfo)score).HasReplay,
|
|
||||||
Date = score.Date,
|
Date = score.Date,
|
||||||
PP = score.PP,
|
PP = score.PP,
|
||||||
Rank = score.Rank,
|
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).
|
/// 13 2022-01-13 Final migration of beatmaps and scores to realm (multiple new storage fields).
|
||||||
/// 14 2022-03-01 Added BeatmapUserSettings to BeatmapInfo.
|
/// 14 2022-03-01 Added BeatmapUserSettings to BeatmapInfo.
|
||||||
/// 15 2022-07-13 Added LastPlayed to BeatmapInfo.
|
/// 15 2022-07-13 Added LastPlayed to BeatmapInfo.
|
||||||
|
/// 16 2022-07-15 Removed HasReplay from ScoreInfo.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private const int schema_version = 15;
|
private const int schema_version = 16;
|
||||||
|
|
||||||
/// <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.
|
||||||
|
@ -129,8 +129,7 @@ namespace osu.Game.Online.API.Requests.Responses
|
|||||||
Rank = Rank,
|
Rank = Rank,
|
||||||
Statistics = Statistics,
|
Statistics = Statistics,
|
||||||
Date = EndedAt ?? DateTimeOffset.Now,
|
Date = EndedAt ?? DateTimeOffset.Now,
|
||||||
Hash = "online", // TODO: temporary?
|
Hash = HasReplay ? "online" : string.Empty, // TODO: temporary?
|
||||||
HasReplay = HasReplay,
|
|
||||||
Mods = mods,
|
Mods = mods,
|
||||||
PP = PP,
|
PP = PP,
|
||||||
};
|
};
|
||||||
|
@ -45,7 +45,7 @@ namespace osu.Game.Scoring
|
|||||||
|
|
||||||
public double Accuracy { get; set; }
|
public double Accuracy { get; set; }
|
||||||
|
|
||||||
public bool HasReplay { get; set; }
|
public bool HasReplay => !string.IsNullOrEmpty(Hash);
|
||||||
|
|
||||||
public DateTimeOffset Date { get; set; }
|
public DateTimeOffset Date { get; set; }
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ namespace osu.Game.Screens.Ranking
|
|||||||
if (State.Value == DownloadState.LocallyAvailable)
|
if (State.Value == DownloadState.LocallyAvailable)
|
||||||
return ReplayAvailability.Local;
|
return ReplayAvailability.Local;
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(Score.Value?.Hash))
|
if (Score.Value?.HasReplay == true)
|
||||||
return ReplayAvailability.Online;
|
return ReplayAvailability.Online;
|
||||||
|
|
||||||
return ReplayAvailability.NotAvailable;
|
return ReplayAvailability.NotAvailable;
|
||||||
|
Loading…
Reference in New Issue
Block a user