dweymouth / supersonic

A lightweight and full-featured cross-platform desktop client for self-hosted music servers
GNU General Public License v3.0
675 stars 26 forks source link

fix: Avoid crash when removing last track from queue #271

Closed adamantike closed 7 months ago

adamantike commented 7 months ago

Steps to reproduce

  1. Put multiple tracks in the queue (visible in the "Now Playing" panel).
  2. Start reproducing any track in the queue.
  3. Select tracks from the one being reproduced until the end of the queue (this was also reproducible when the last track is playing, and only that one is selected in this step).
  4. Select the "Remove from queue" option.

Expected

  1. Selected tracks are removed from the queue.
  2. Player is now in Stopped state.
  3. If there are more tracks in the queue (not all of them were selected to be removed in step 3), then clicking on the "Play" button starts reproducing the queue from the beginning.

Actual

Currently, the app crashes when step 4 is applied.

Fixes #270.

dweymouth commented 7 months ago

Lol.. we both fixed this at the same time (and in the same way) 🤣

If you feel like working on more, maybe you could try #267? I haven't looked at that yet

dweymouth commented 7 months ago

.. And you found the same non-refresh bug in the Now Playing page! That one I fixed differently, by making tracklist.SetTracks always refresh - more consistent with the Fyne APIs of the builtin widgets

adamantike commented 7 months ago

Glad to see your solution for the tracklist not being refreshed, that will be a lot more robust to avoid manually refreshing in different parts of the codebase! :rocket:

dweymouth commented 7 months ago

To avoid this in the future, you can feel free to comment on an issue that you're looking into it (and I'll do the same, or assign the issue to myself) :)