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

Fix crash on select dupe song in playlist #950

Merged
merged 11 commits into from
Mar 1, 2024

Conversation

soncaokim
Copy link
Collaborator

@soncaokim soncaokim commented Feb 15, 2024

Fixes #936

This is quite a big change, involving the introduction of unique and stable ID for each song in a static playlist (on the same idea that @Octoton implemented on the playing queue with the IndexedSong class).

To support this, I needed to change the API of multiple classes, from using ArrayList<Song> to List<? extends Song>.

I took the opportunity to do some cleanup and limited the concept of IndexedSong to only where it's necessary.

--

Note that with this PR, if one select a duplicated item in a playlist, both copies will be selected. Any subsequent action on the selection (i.e. remove from playlist) will be applied to all the dupes (i.e. all occurence of the selected song will be removed).

Quite counter-intuitive for me.

Another PR (with important refactoring on the handling of multi-select in the case of dupe) will be proposed to handle this part. Relevant code are in https://github.com/VinylMusicPlayer/VinylMusicPlayer/tree/refactor-multi-select

@soncaokim soncaokim added the bug label Feb 15, 2024
@soncaokim soncaokim force-pushed the fix-crash-on-select-dupe-song-in-playlist branch from 0485833 to 03da4c4 Compare February 21, 2024 18:10
@soncaokim
Copy link
Collaborator Author

@AdrienPoupa @Octoton Can you please have a look on this PR? I've updated the description to explain the reason behind this big change.

Thanks!

@soncaokim soncaokim mentioned this pull request Feb 22, 2024
2 tasks
@soncaokim soncaokim merged commit 09fed09 into master Mar 1, 2024
2 checks passed
@soncaokim soncaokim deleted the fix-crash-on-select-dupe-song-in-playlist branch March 1, 2024 17:19
@soncaokim soncaokim mentioned this pull request Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash when selecting a track in a playlist containing duplicates of the same track
1 participant