-
Notifications
You must be signed in to change notification settings - Fork 228
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
Tracks page doesn't properly reflect changes #348
Comments
Same thing for me, this is kind of annoying. |
Can confirm this on latest/macOS as well. |
Yeah, pretty sure thats a problem with us not invalidating the cached api response/altering the local copy on updates Wasn't able to look at it till now, though. Maybe in the next couple days 💀 |
I'm not sure exactly what the issue is, but it's not that. Lines 293 to 305 in 64362ea
Here is where the local state is updated. If you print out the contents of the Vector after it's modified, the contents represent the correct state. In |
It seems the way the Track and Album object are handled is different. I'm looking into this now. My first thought is that SavedAlbum is stored as a hashset of str while SavedTracks are a hashset of the custom TrackId. |
Maybe because TrackId's implement copy instead of clone which Albums do? Eh maybe this is a frontend refresh thing. |
This appears to not to affect playlists when removing a song because we are specifically resubmitting the playlist data load command: psst/psst-gui/src/ui/playlist.rs Lines 172 to 173 in 38422b1
As well, adding a song to a playlist doesn't have issues because playlist navigation always reloads the PlaylistDetails. It looks like it shouldn't, but the LOAD_DETAIL command always gets sent here because data.playlist_detail.playlist is ALWAYS psst/psst-gui/src/controller/nav.rs Lines 47 to 53 in 38422b1
|
@literallyjustroy If you're interested in submitted a PR to revise this, I'd be more than happy to look over it! |
Still digging around on the internal logic here. A quick and dirty fix would just be force a full reload on all track lists when selected (like playlists do now). But then accessing your library would be slower than it is today, so it's really not ideal. The saved_tracks is actually updated correctly during a remove track/add track, it's just that the tracks list widget doesn't use the new data. This is especially noticeable if you remove the top track from your saved songs, then try to play it. It'll start playing the one below it (since internally that is the first song in the list, even though the ui doesn't show it). Not familiar with druid/not sure how to tell the page to reload the widget. Ideally we do a combination. We should show the correct data we have saved locally right on navigation, then we can reload the tracks in the background and if there's an update we'll see it then. |
Okay so the problem with the lack of ui updating is (I'd guess this is pretty obvious if you're familiar at all with druid) is centered around Lenses. In particular I think the problem is that the Interestingly, Saved Albums correctly updates instantly when getting removed... |
Ah so it doesn't need to be a promise? We need to immediately update that object? |
Describe the bug
When adding or removing saved tracks, the tracks page does not reflect those changes properly until the app is restarted.
To Reproduce
This also applies when unsaving songs.
Expected behavior
The list will be updated properly.
Environment
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: