mirror of
https://github.com/osukey/osukey.git
synced 2025-05-18 03:57:32 +09:00
Merge pull request #7876 from smoogipoo/fix-playlist-id
Fix playlist items added with the wrong IDs
This commit is contained in:
commit
cf973f7730
@ -134,6 +134,22 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
AddAssert("playlist has 2 items", () => Room.Playlist.Count == 2);
|
AddAssert("playlist has 2 items", () => Room.Playlist.Count == 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestAddItemAfterRearrangement()
|
||||||
|
{
|
||||||
|
AddStep("create new item", () => songSelect.BeatmapDetails.CreateNewItem());
|
||||||
|
AddStep("create new item", () => songSelect.BeatmapDetails.CreateNewItem());
|
||||||
|
AddStep("rearrange", () =>
|
||||||
|
{
|
||||||
|
var item = Room.Playlist[0];
|
||||||
|
Room.Playlist.RemoveAt(0);
|
||||||
|
Room.Playlist.Add(item);
|
||||||
|
});
|
||||||
|
|
||||||
|
AddStep("create new item", () => songSelect.BeatmapDetails.CreateNewItem());
|
||||||
|
AddAssert("new item has id 2", () => Room.Playlist.Last().ID == 2);
|
||||||
|
}
|
||||||
|
|
||||||
private class TestMatchSongSelect : MatchSongSelect
|
private class TestMatchSongSelect : MatchSongSelect
|
||||||
{
|
{
|
||||||
public new MatchBeatmapDetailArea BeatmapDetails => (MatchBeatmapDetailArea)base.BeatmapDetails;
|
public new MatchBeatmapDetailArea BeatmapDetails => (MatchBeatmapDetailArea)base.BeatmapDetails;
|
||||||
|
@ -62,7 +62,7 @@ namespace osu.Game.Screens.Select
|
|||||||
{
|
{
|
||||||
PlaylistItem item = new PlaylistItem
|
PlaylistItem item = new PlaylistItem
|
||||||
{
|
{
|
||||||
ID = (Playlist.LastOrDefault()?.ID + 1) ?? 0,
|
ID = Playlist.Count == 0 ? 0 : Playlist.Max(p => p.ID) + 1
|
||||||
};
|
};
|
||||||
|
|
||||||
populateItemFromCurrent(item);
|
populateItemFromCurrent(item);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user