mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
Handle unplayable track at start of playlist
This commit is contained in:
parent
01813cf7c9
commit
1da80ce480
1 changed files with 9 additions and 5 deletions
|
@ -910,13 +910,17 @@ impl SpircTask {
|
||||||
| SpircPlayStatus::Stopped => (),
|
| SpircPlayStatus::Stopped => (),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mark unavailable tracks so we can skip them later
|
// Mark unavailable tracks so we can skip them later
|
||||||
fn handle_unavailable(&mut self, track_id: SpotifyId) {
|
fn handle_unavailable(&mut self, track_id: SpotifyId) {
|
||||||
let unavailables = self.get_track_index_for_spotify_id(
|
let playing_index = self.state.get_playing_track_index() as usize;
|
||||||
&track_id,
|
let search_from = if playing_index == self.state.get_track().len() - 1 {
|
||||||
self.state.get_playing_track_index() as usize,
|
trace!("Cycling back to 0 instead of {:?}", playing_index);
|
||||||
);
|
0
|
||||||
|
} else {
|
||||||
|
playing_index
|
||||||
|
};
|
||||||
|
let unavailables = self.get_track_index_for_spotify_id(&track_id, search_from);
|
||||||
for &index in unavailables.iter() {
|
for &index in unavailables.iter() {
|
||||||
debug_assert_eq!(self.state.get_track()[index].get_gid(), track_id.to_raw());
|
debug_assert_eq!(self.state.get_track()[index].get_gid(), track_id.to_raw());
|
||||||
let mut unplayable_track_ref = TrackRef::new();
|
let mut unplayable_track_ref = TrackRef::new();
|
||||||
|
|
Loading…
Reference in a new issue