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

Custom playlist music order was ignored. Queue music by filter and collection. #30343

Draft
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

wezwery
Copy link
Contributor

@wezwery wezwery commented Oct 18, 2024

Added the ability to filter music by search or by music collection to play.

Added the ability to filter music by search or by music collection to play.
@bdach
Copy link
Collaborator

bdach commented Oct 18, 2024

Bit weird to see this opened given that I explicitly assigned myself to the issue with the intent to work on it but sure I guess?

@wezwery
Copy link
Contributor Author

wezwery commented Oct 18, 2024

I saw it only after the problem was solved...

@wezwery
Copy link
Contributor Author

wezwery commented Oct 18, 2024

I'm not claiming approval, as there might be a simpler approach to fixing this issue.

@bdach
Copy link
Collaborator

bdach commented Oct 18, 2024

Yeah not a problem I guess, just a tad strange. I'll review this by Monday at the latest.

@wezwery wezwery changed the title Fixed a bug where custom playlist music order was ignored. Custom playlist music order was ignored. Queue music by filter and collection. Oct 19, 2024
Copy link
Collaborator

@bdach bdach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have several issues with this, but they all boil down to the central design of this, so I'm going to leave it at just the one comment about the problem with the design

osu.Game/Overlays/MusicController.cs Outdated Show resolved Hide resolved
Comment on lines 55 to 64
if (currentCriteria == criteria)
updateMusicControllerPlaylist();

items.FilterCompleted += () => Scheduler.AddOnce(updateMusicControllerPlaylist);

void updateMusicControllerPlaylist()
{
musicController.Playlist.Clear();
musicController.Playlist.AddRange(AllVisibleSets);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I was skeptical that this did anything, in particular that this will support reordering items correctly, and yet... it does? It does because every reorder of items in the list calls OnItemsChanged(), and every OnItemsChanged() for this container calls Filter(). And thus the list is cleared and re-populated anew on every item reorder.

Stress-testing it on a huge database (~230MB) it is pretty visible in there, although maybe not as much as I'd actually expect it to be after inferring the above:

image

@ppy/team-client am I the only one who has a problem with this? The code is otherwise (deceptively?) simple and it appears to work correctly...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bdach if you think it's okay then i'm fine with the simple approach until someone complains about performance.

@peppy peppy requested review from peppy and removed request for peppy October 23, 2024 06:48
osu.Game/Overlays/MusicController.cs Outdated Show resolved Hide resolved
@bdach
Copy link
Collaborator

bdach commented Nov 1, 2024

Test failures require addressing

@wezwery
Copy link
Contributor Author

wezwery commented Nov 1, 2024

I don't understand why github tests don't pass, because everything works for me.

@wezwery wezwery requested a review from bdach November 7, 2024 16:07
.Select(s => new RealmLive<BeatmapSetInfo>(s, realm));
private IEnumerable<Live<BeatmapSetInfo>> getBeatmapSets()
{
return Playlist.IsDefault
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the meaning of this conditional? Why is this ever required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is necessary because github tests fail music overlay tests when loading beatmaps. The playlist is always empty.

@wezwery
Copy link
Contributor Author

wezwery commented Nov 11, 2024

The tests fail because the game does not have time to load all the game components, so it first tries to pass the tests and then load the remaining components.

Although on a local Windows machine all the latest code passes tests.

I can revert the changes back to bd467a6 to make the tests pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Changing the track queue does not affect the sequence
4 participants