z-huang / InnerTune

A Material 3 YouTube Music client for Android
GNU General Public License v3.0
4.46k stars 274 forks source link

If song changes while you are adding it to a playlist, wrong song gets added. #1488

Open dt192 opened 1 month ago

dt192 commented 1 month ago

Checklist

Steps to reproduce the bug

Click add song to playlist Let the song end and move on Click the playlist to add it to

Expected behavior

The song that was playing when I clicked the add button gets added to playlist.

Actual behavior

The song that's currently playing gets added.

Screenshots/Screen recordings

No response

Logs

N/A

InnerTune version

0.5.9

Android version

14

Additional information

I was listening to a song, decided I liked it and to add it to playlist. I clicked add to playlist, created a new playlist for it, then clicked the new playlist to add it, but during that time the innerTune had moved on to the next track and so that got added instead of the one I had try to add.

z-huang commented 1 month ago

This won't happen frequently, right? A song is 3~4 min on average, and the process to add to playlist only takes few seconds.

dt192 commented 1 month ago

Well, you usually decide if you liked a song enough to add it to a playlist once you are near the end of a song and when creating a new playlist you need to think of a name for your playlist, so I think in that situation it's fairly likely. If just adding to an already created playlist not so much. So a low priority bug.

ruskcoder commented 1 month ago

I think just close the menu if a new song plays, solves the solution and keeps the UI consistent.

dt192 commented 1 month ago

I think just close the menu if a new song plays, solves the solution and keeps the UI consistent.

Having the target of operations in a menu change to something else without you choosing for it to do so is inconsistent. You would expect the target to be the song you were on when you open the menu.

Is this a difficult bug to fix? It seems to me you would just need to save the uid or data structure for the current song to a variable when opening the menu and have any menu actions use that rather than the info of whatever is currently playing.

ruskcoder commented 1 month ago

I think just close the menu if a new song plays, solves the solution and keeps the UI consistent.

Having the target of operations in a menu change to something else without you choosing for it to do so is inconsistent. You would expect the target to be the song you were on when you open the menu.

Is this a difficult bug to fix? It seems to me you would just need to save the uid or data structure for the current song to a variable when opening the menu and have any menu actions use that rather than the info of whatever is currently playing.

It's not that difficult, but it would be adding variables for no reason, and cause confusion to the user "which song would be added, the new song or the old one'. If it were to close the menu, it would make sense because the song state was reset.

dt192 commented 1 month ago

I think just close the menu if a new song plays, solves the solution and keeps the UI consistent.

Having the target of operations in a menu change to something else without you choosing for it to do so is inconsistent. You would expect the target to be the song you were on when you open the menu. Is this a difficult bug to fix? It seems to me you would just need to save the uid or data structure for the current song to a variable when opening the menu and have any menu actions use that rather than the info of whatever is currently playing.

It's not that difficult, but it would be adding variables for no reason, and cause confusion to the user "which song would be added, the new song or the old one'. If it were to close the menu, it would make sense because the song state was reset.

Having a menu I'm using close while I'm using it is annoying and confusing. That sounds like a bug.

There is no confusion doing it the way I said. I'm pretty confident that nobody has ever opened the menu to add the song that hasn't even started playing yet to a playlist, they always want to add the song that is currently playing at the time they open the menu to add it.

dt192 commented 1 month ago

I just tested in both YouTube Music and Spotify and they both work as I suggested above.