Skip to content

player: Do not reset validation if the playlist is unchanged

Jean Felder requested to merge wip/jfelder/player-discovery into master

_validation_indexes keeps track of the songs being validated. Every time a new playlist is loaded or a new song from the same playlist is loaded by clicking on it, this list is reset. In the latter case, it works fine in most of the cases because the discovery mechanism (which is asynchronous) is fast enough to end before the user can click on an other song. Indeed, the list is already empty when it is reset. However, on a slow configuration, it is possible to select an other song before the end of the discovery mechanism. So, the validation list is reset even if a discovery is running. This results in a crash as reported by #252 (closed).

The solution is to not reset _validation_indexes if the playlist is unchanged. Also, introduce a new ValidationStatus (DOING) when a song is being validated. This prevents to queue multiple times the same song on a slow configuration.

closes: #252 (closed)

Merge request reports