Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No longer remove expired playlist items from Room model #30830

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 1 addition & 17 deletions osu.Game/Online/Rooms/Room.cs
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,8 @@ public void CopyFrom(Room other)
{
RoomID = other.RoomID;
Name = other.Name;

Category = other.Category;

if (other.Host != null && Host?.Id != other.Host.Id)
Host = other.Host;

Host = other.Host;
ChannelId = other.ChannelId;
Status = other.Status;
Availability = other.Availability;
Expand All @@ -387,22 +383,10 @@ public void CopyFrom(Room other)
PlaylistItemStats = other.PlaylistItemStats;
CurrentPlaylistItem = other.CurrentPlaylistItem;
AutoSkip = other.AutoSkip;

other.RemoveExpiredPlaylistItems();

Playlist = other.Playlist;
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)]
public class RoomPlaylistItemStats
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ protected override Task Poll()
}

foreach (var incoming in result)
{
incoming.RemoveExpiredPlaylistItems();
RoomManager.AddOrUpdateRoom(incoming);
}

initialRoomsReceived.Value = true;
tcs.SetResult(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ protected override Task Poll()

req.Success += result =>
{
result.RemoveExpiredPlaylistItems();
RoomManager.AddOrUpdateRoom(result);
tcs.SetResult(true);
};
Expand Down
Loading