mirror of
https://github.com/ppy/osu.git
synced 2025-01-08 21:22:56 +08:00
No longer remove expired playlist items from Room
model
This commit is contained in:
parent
479ff7eb41
commit
e59ac9e7c8
@ -388,21 +388,10 @@ namespace osu.Game.Online.Rooms
|
|||||||
CurrentPlaylistItem = other.CurrentPlaylistItem;
|
CurrentPlaylistItem = other.CurrentPlaylistItem;
|
||||||
AutoSkip = other.AutoSkip;
|
AutoSkip = other.AutoSkip;
|
||||||
|
|
||||||
other.RemoveExpiredPlaylistItems();
|
|
||||||
|
|
||||||
Playlist = other.Playlist;
|
Playlist = other.Playlist;
|
||||||
RecentParticipants = other.RecentParticipants;
|
RecentParticipants = other.RecentParticipants;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveExpiredPlaylistItems()
|
|
||||||
{
|
|
||||||
// Todo: This is not the best way/place to do this, but the intention is to display all playlist items when the room has ended,
|
|
||||||
// and display only the non-expired playlist items while the room is still active. In order to achieve this, all expired items are removed from the source Room.
|
|
||||||
// More refactoring is required before this can be done locally instead - DrawableRoomPlaylist is currently directly bound to the playlist to display items in the room.
|
|
||||||
if (Status is not RoomStatusEnded)
|
|
||||||
Playlist = Playlist.Where(i => !i.Expired).ToArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonObject(MemberSerialization.OptIn)]
|
[JsonObject(MemberSerialization.OptIn)]
|
||||||
public class RoomPlaylistItemStats
|
public class RoomPlaylistItemStats
|
||||||
{
|
{
|
||||||
|
@ -60,10 +60,7 @@ namespace osu.Game.Screens.OnlinePlay.Components
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach (var incoming in result)
|
foreach (var incoming in result)
|
||||||
{
|
|
||||||
incoming.RemoveExpiredPlaylistItems();
|
|
||||||
RoomManager.AddOrUpdateRoom(incoming);
|
RoomManager.AddOrUpdateRoom(incoming);
|
||||||
}
|
|
||||||
|
|
||||||
initialRoomsReceived.Value = true;
|
initialRoomsReceived.Value = true;
|
||||||
tcs.SetResult(true);
|
tcs.SetResult(true);
|
||||||
|
@ -36,7 +36,6 @@ namespace osu.Game.Screens.OnlinePlay.Components
|
|||||||
|
|
||||||
req.Success += result =>
|
req.Success += result =>
|
||||||
{
|
{
|
||||||
result.RemoveExpiredPlaylistItems();
|
|
||||||
RoomManager.AddOrUpdateRoom(result);
|
RoomManager.AddOrUpdateRoom(result);
|
||||||
tcs.SetResult(true);
|
tcs.SetResult(true);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user