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

the order of remote autogenerated bookmarked playlists changes when they are opened #11019

Open
6 tasks done
ajgae opened this issue Apr 29, 2024 · 3 comments
Open
6 tasks done
Assignees
Labels
bug Issue is related to a bug GUI Issue is related to the graphical user interface playlist Anything to do with playlists in the app

Comments

@ajgae
Copy link

ajgae commented Apr 29, 2024

Checklist

  • I am able to reproduce the bug with the latest version given here: CLICK THIS LINK.
  • I made sure that there are no existing issues - open or closed - which I could contribute my information to.
  • I have read the FAQ and my problem isn't listed.
  • I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
  • This issue contains only one bug.
  • I have read and understood the contribution guidelines.

Affected version

0.27.0

Steps to reproduce the bug

  1. open NewPipe
  2. create a local playlist
  3. bookmark one user-created remote playlist
  4. bookmark multiple youtube-generated remote playlists (e.g. found by looking for music abums using the Albums search filter)
  5. move the local playlist and the user-created remote playlist to the top of the bookmarked playlists
  6. for each youtube-generated remote playlist, open it then go back to the bookmarked playlists view

Expected behavior

the order of playlists should not change when the playlists are opened

Actual behavior

  • when opened, the youtube generated remote playlists are moved up to the top of the bookmarked playlists, above the user-created remote playlist and the local playlist, where they are ordered alphabetically among themselves
  • when opened, neither the local playlist nor the user-created remote playlist are sent back up to the top of the bookmarked playlists (expected behavior)

Screenshots/Screen recordings

video_2024-04-29_16-00-46.mp4

Logs

No response

Affected Android/Custom ROM version

Android 12

Affected device model

Samsung Galaxy S10

Additional information

No response

@ajgae ajgae added bug Issue is related to a bug needs triage Issue is not yet ready for PR authors to take up labels Apr 29, 2024
@ajgae
Copy link
Author

ajgae commented Apr 29, 2024

reopening as a new issue from a discussion on #10993, as suggested by @opusforlife2. Here is the state of my research on the topic so far:

  • the getPlaylists() queries in the RemotePlaylistDAO and local playlist DAO classes seem to be ordered by display index, as expected, which lets me think that the issue is with either merge logic or the updating of display indices, but not with the queries themselves
  • the fact that only autogenerated remote playlists are affected is very strange and confuses me greatly
  • the fact that remote playlists are sorted alphabetically before all other playlists may indicate that they share the same display index
  • this line sets the display index to -1 for all remote playlists by default (which is strange, because newly bookmarked remote playlists do not appear at the top of the bookmarked playlists but at the bottom)
  • the only place in the entire codebase where setDisplayIndex() is called on a PlaylistRemoteEntity is in BookmarkFragment.saveImmediate(), which is called by BookmarkFragment.onPause() (this corresponds with the moment at which the playlists are moved all the way up)
    • in saveImmediate(), debounceSaver.getIsModified() returns false so the function returns immediately. The code which computes and updates the display index for playlists is not executed. it seems that the issue is with the debounceSaver in some way, but i do not understand this part of the application very well

@opusforlife2 opusforlife2 added GUI Issue is related to the graphical user interface playlist Anything to do with playlists in the app and removed needs triage Issue is not yet ready for PR authors to take up labels Apr 29, 2024
@ajgae
Copy link
Author

ajgae commented Apr 30, 2024

you can consider that i working on this btw, I just won't have time in the next couple of days.

Here's a new specificity i observed about the behavior (shown in the video below): the buggy reordering is only triggered when the playlist is loaded. Once it has been loaded, opening it does not trigger the reordering

video_2024-04-30_11-05-52.mp4

@opusforlife2
Copy link
Collaborator

@ajgae If it's a small bug fix, easy to review, sure. Otherwise it might be postponed for, or after, the rewrite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is related to a bug GUI Issue is related to the graphical user interface playlist Anything to do with playlists in the app
Projects
None yet
Development

No branches or pull requests

2 participants