Replace tournament beatmap storage type with lightweight model

This commit is contained in:
Salman Ahmed
2022-06-18 01:34:09 +03:00
parent 200b23c689
commit 9f97d1a7db
15 changed files with 29 additions and 31 deletions

View File

@ -211,7 +211,7 @@ namespace osu.Game.Tournament
{
var beatmapsRequiringPopulation = ladder.Rounds
.SelectMany(r => r.Beatmaps)
.Where(b => string.IsNullOrEmpty(b.Beatmap?.BeatmapSet?.Title) && b.ID > 0).ToList();
.Where(b => b.Beatmap?.OnlineID == 0 && b.ID > 0).ToList();
if (beatmapsRequiringPopulation.Count == 0)
return false;
@ -222,7 +222,7 @@ namespace osu.Game.Tournament
var req = new GetBeatmapRequest(new APIBeatmap { OnlineID = b.ID });
API.Perform(req);
b.Beatmap = req.Response ?? new APIBeatmap();
b.Beatmap = new TournamentBeatmap(req.Response ?? new APIBeatmap());
updateLoadProgressMessage($"Populating round beatmaps ({i} / {beatmapsRequiringPopulation.Count})");
}
@ -238,7 +238,7 @@ namespace osu.Game.Tournament
var beatmapsRequiringPopulation = ladder.Teams
.SelectMany(r => r.SeedingResults)
.SelectMany(r => r.Beatmaps)
.Where(b => string.IsNullOrEmpty(b.Beatmap?.BeatmapSet?.Title) && b.ID > 0).ToList();
.Where(b => b.Beatmap?.OnlineID == 0 && b.ID > 0).ToList();
if (beatmapsRequiringPopulation.Count == 0)
return false;
@ -249,7 +249,7 @@ namespace osu.Game.Tournament
var req = new GetBeatmapRequest(new APIBeatmap { OnlineID = b.ID });
API.Perform(req);
b.Beatmap = req.Response ?? new APIBeatmap();
b.Beatmap = new TournamentBeatmap(req.Response ?? new APIBeatmap());
updateLoadProgressMessage($"Populating seeding beatmaps ({i} / {beatmapsRequiringPopulation.Count})");
}