Avoid endless loop if all tracks are unplayable. #1455

Closed
wants to merge 3 commits into
from

Conversation

3 participants
@dublok
Contributor

dublok commented Feb 17, 2016

Limit the number of tries for changing to the next track.
The limit is 2 * tracklist length to get all tracks in a shuffled playlist.

Please have a closer look to _on_about_to_finish. Seems there was a loop if backend==None.

Fixes #1454

Avoid endless loop if all tracks are unplayable.
Limit the number of tries for changing to the nest track.
The limit is 2 * tracklist length get all tracks in a shuffled playlist.
@adamcik

This comment has been minimized.

Show comment
Hide comment
@adamcik

adamcik Feb 17, 2016

Member

Looks like a fairly simple way to get around the shuffle problem which has blocked previous attempts at getting the corner cases for this. Don't we need the same for next and prev. It would also be good with some tests for this, even if they ignore the shuffle corner case.

Member

adamcik commented Feb 17, 2016

Looks like a fairly simple way to get around the shuffle problem which has blocked previous attempts at getting the corner cases for this. Don't we need the same for next and prev. It would also be good with some tests for this, even if they ignore the shuffle corner case.

@dublok

This comment has been minimized.

Show comment
Hide comment
@dublok

dublok Feb 17, 2016

Contributor

Probably yes. I'll check tomorrow.

Contributor

dublok commented Feb 17, 2016

Probably yes. I'll check tomorrow.

@adamcik

This comment has been minimized.

Show comment
Hide comment
@adamcik

adamcik Feb 17, 2016

Member

Thanks for taking the time to help fix this :-)

Member

adamcik commented Feb 17, 2016

Thanks for taking the time to help fix this :-)

@dublok

This comment has been minimized.

Show comment
Hide comment
@dublok

dublok Feb 17, 2016

Contributor

I added the check for next and previous.
The the tests have to wait..

(Can we delay the test for a follow-up PR?)

Contributor

dublok commented Feb 17, 2016

I added the check for next and previous.
The the tests have to wait..

(Can we delay the test for a follow-up PR?)

Add tests to ensure that play, next will not busy-loop
Test PlaybackController functions play(), next(), previous()
and _on_about_to_finish() that they will not loop forever
if all tracks are unplayable.
@dublok

This comment has been minimized.

Show comment
Hide comment
@dublok

dublok Feb 18, 2016

Contributor

Surprisingly it is possible write test that ensure that the functions will not loop forever ;-)
Tests done.

Contributor

dublok commented Feb 18, 2016

Surprisingly it is possible write test that ensure that the functions will not loop forever ;-)
Tests done.

@jodal jodal added this to the v2.0.1 - Bug fixes milestone Feb 19, 2016

@adamcik

This comment has been minimized.

Show comment
Hide comment
@adamcik

adamcik Mar 25, 2016

Member

Looked over the code now, just needs to be merged correctly into release-2.0 as we want this in our 2.0.1 release based on the assigned milestone.

Member

adamcik commented Mar 25, 2016

Looked over the code now, just needs to be merged correctly into release-2.0 as we want this in our 2.0.1 release based on the assigned milestone.

@jodal

This comment has been minimized.

Show comment
Hide comment
@jodal

jodal Mar 26, 2016

Member

I rebased and merged this into release-2.0 in commit 5a371b8.

Member

jodal commented Mar 26, 2016

I rebased and merged this into release-2.0 in commit 5a371b8.

@jodal jodal closed this Mar 26, 2016

@jodal jodal self-assigned this Mar 26, 2016

tmyersjstar added a commit to tmyersjstar/mopidy that referenced this pull request Apr 5, 2016

@jcass77 jcass77 referenced this pull request in rectalogic/mopidy-pandora Apr 18, 2016

Closed

Can't get Pandora to play #50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment