From b7c047bca2404252b9fa5b631e31a7719efe83fb Mon Sep 17 00:00:00 2001 From: Roderick van Domburg Date: Mon, 27 Dec 2021 09:35:11 +0100 Subject: [PATCH] Fix alternative tracks --- playback/src/player.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/playback/src/player.rs b/playback/src/player.rs index c0748987..2c5d25c3 100644 --- a/playback/src/player.rs +++ b/playback/src/player.rs @@ -694,7 +694,10 @@ struct PlayerTrackLoader { impl PlayerTrackLoader { async fn find_available_alternative(&self, audio: AudioItem) -> Option { - if audio.availability.is_ok() { + if let Err(e) = audio.availability { + error!("Track is unavailable: {}", e); + None + } else if !audio.files.is_empty() { Some(audio) } else if let Some(alternatives) = &audio.alternatives { let alternatives: FuturesUnordered<_> = alternatives @@ -708,6 +711,7 @@ impl PlayerTrackLoader { .next() .await } else { + error!("Track should be available, but no alternatives found."); None } }