Fix cases of dynamically assigning Beatmaps to BeatmapSetInfo using list assignment

This commit is contained in:
Dean Herbert
2021-11-24 13:25:26 +09:00
parent 49c2cb9125
commit 8c60f37508
13 changed files with 123 additions and 100 deletions

View File

@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
@ -220,6 +221,8 @@ namespace osu.Game.Tests.Visual
{
var beatmap = CreateBeatmap(ruleset ?? Ruleset.Value).BeatmapInfo;
Debug.Assert(beatmap.BeatmapSet != null);
return new APIBeatmapSet
{
OnlineID = ((IBeatmapSetInfo)beatmap.BeatmapSet).OnlineID,
@ -230,13 +233,17 @@ namespace osu.Game.Tests.Visual
Card = "https://assets.ppy.sh/beatmaps/163112/covers/card.jpg",
List = "https://assets.ppy.sh/beatmaps/163112/covers/list.jpg"
},
Title = beatmap.BeatmapSet.Metadata.Title,
TitleUnicode = beatmap.BeatmapSet.Metadata.TitleUnicode,
Artist = beatmap.BeatmapSet.Metadata.Artist,
ArtistUnicode = beatmap.BeatmapSet.Metadata.ArtistUnicode,
Author = beatmap.BeatmapSet.Metadata.Author,
Source = beatmap.BeatmapSet.Metadata.Source,
Tags = beatmap.BeatmapSet.Metadata.Tags,
Title = beatmap.Metadata.Title,
TitleUnicode = beatmap.Metadata.TitleUnicode,
Artist = beatmap.Metadata.Artist,
ArtistUnicode = beatmap.Metadata.ArtistUnicode,
Author = new APIUser
{
Username = beatmap.Metadata.Author.Username,
Id = beatmap.Metadata.Author.OnlineID
},
Source = beatmap.Metadata.Source,
Tags = beatmap.Metadata.Tags,
Beatmaps = new[]
{
new APIBeatmap