Queue behavior & position tracking for consistency#385
Closed
arch-btw wants to merge 3 commits intojpochyla:masterfrom
arch-btw:patch-2
Closed
Queue behavior & position tracking for consistency#385arch-btw wants to merge 3 commits intojpochyla:masterfrom arch-btw:patch-2
arch-btw wants to merge 3 commits intojpochyla:masterfrom
arch-btw:patch-2
Conversation
Trying to improve the queue struct, meaning the way it behaves during playback. So that the order of songs in the queue is consistent when switching between different playback behaviors or modifying queue. This fixes the following error, which makes the program unusable until restarting it: ``` thread '<unnamed>' panicked at 'index out of bounds: the len is 2 but the index is 10', psst-core/src/player/queue.rs:57:13 ``` So now it's making sure that the positions of the songs in the queue are always tracked properly by initializing the positions vector with the original order of the items. So that the songs are always played in the right order even if the queue behavior changes. Also some typo (behaviour -> behavior) and removed some unnecessary code.
Contributor
Author
|
Could use some advice :( |
Contributor
Author
|
I'm going about this the wrong way, the error is in the play function of playback.rs ... can be fixed by checking that the provided position value is within bounds before sending the LoadQueue command to player. Sorry about this, still getting used to this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Trying to improve the queue struct.... by which I mean the way it behaves during playback. So that the order of songs in the queue is consistent when switching between different playback behaviors or modifying queue.
This fixes the following error, which makes the program unusable until restarting it:
With these changes it now is making sure that the positions of the songs in the queue are always tracked properly by initializing the positions vector with the original order of the items. So that the songs are always played in the right order even if the queue behavior changes.
Also fixed a typo (behaviour -> behavior) and removed some unnecessary code.