Skip to content

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#385
arch-btw wants to merge 3 commits intojpochyla:masterfrom
arch-btw:patch-2

Conversation

@arch-btw
Copy link
Copy Markdown
Contributor

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:

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 

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.

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.
@arch-btw
Copy link
Copy Markdown
Contributor Author

Could use some advice :(

@arch-btw
Copy link
Copy Markdown
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.

@arch-btw arch-btw closed this Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant