fix: Update to latest Librespot to fix playback
* fix: adapt to librespot SpotifyUri API changes Fixes compatibility with librespot PR #1622 which changed the API from SpotifyId::from_uri() to SpotifyUri::from_uri(). Changes: - Updated src/spotify_worker.rs to use SpotifyUri instead of SpotifyId - Updated Cargo.toml to use librespot from official repository (merge commit a9122dcb from PR #1622) - Regenerated Cargo.lock with updated dependencies Fixes #1732 Depends on librespot-org/librespot#1622 (merged) * Switch to 0.8.0 release * Update CHANGELOG * `cargo fmt` --------- Co-authored-by: Guilherme Fontes <48162143+gui-baeta@users.noreply.github.com> Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
This commit is contained in:
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Playlist retrieval crashing when list contains podcast episodes
|
||||
- Crash when shifting a song by an amount greater than the queue's length
|
||||
- Crash when displaying songs that do not have an (available) artist
|
||||
- Playback broken due to Spotify API change
|
||||
|
||||
## [1.3.1]
|
||||
|
||||
|
||||
1175
Cargo.lock
generated
1175
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -52,10 +52,10 @@ fern = "0.7"
|
||||
futures = "0.3"
|
||||
ioctl-rs = {version = "0.2", optional = true}
|
||||
libc = "0.2.177"
|
||||
librespot-core = "0.7.1"
|
||||
librespot-oauth = "0.7.1"
|
||||
librespot-playback = {version = "0.7.1", default-features = false, features = ["native-tls"]}
|
||||
librespot-protocol = "0.7.1"
|
||||
librespot-core = "0.8.0"
|
||||
librespot-oauth = "0.8.0"
|
||||
librespot-playback = {version = "0.8.0", default-features = false, features = ["native-tls"]}
|
||||
librespot-protocol = "0.8.0"
|
||||
log = "0.4.28"
|
||||
pancurses = {version = "0.17.0", optional = true}
|
||||
parse_duration = "2.1.1"
|
||||
|
||||
@@ -3,8 +3,8 @@ use crate::model::playable::Playable;
|
||||
use crate::queue::QueueEvent;
|
||||
use crate::spotify::PlayerEvent;
|
||||
use futures::Future;
|
||||
use librespot_core::SpotifyUri;
|
||||
use librespot_core::session::Session;
|
||||
use librespot_core::spotify_id::SpotifyId;
|
||||
use librespot_core::token::Token;
|
||||
use librespot_playback::mixer::Mixer;
|
||||
use librespot_playback::player::{Player, PlayerEvent as LibrespotPlayerEvent};
|
||||
@@ -98,14 +98,14 @@ impl Worker {
|
||||
tokio::select! {
|
||||
cmd = self.commands.next() => match cmd {
|
||||
Some(WorkerCommand::Load(playable, start_playing, position_ms)) => {
|
||||
match SpotifyId::from_uri(&playable.uri()) {
|
||||
Ok(id) => {
|
||||
info!("player loading track: {id:?}");
|
||||
if !id.is_playable() {
|
||||
match SpotifyUri::from_uri(&playable.uri()) {
|
||||
Ok(uri) => {
|
||||
info!("player loading track: {uri:?}");
|
||||
if !uri.is_playable() {
|
||||
warn!("track is not playable");
|
||||
self.events.send(Event::Player(PlayerEvent::FinishedTrack));
|
||||
} else {
|
||||
self.player.load(id, start_playing, position_ms);
|
||||
self.player.load(uri, start_playing, position_ms);
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
@@ -133,9 +133,9 @@ impl Worker {
|
||||
self.token_task = Box::pin(Self::get_token(self.session.clone(), sender));
|
||||
}
|
||||
Some(WorkerCommand::Preload(playable)) => {
|
||||
if let Ok(id) = SpotifyId::from_uri(&playable.uri()) {
|
||||
debug!("Preloading {id:?}");
|
||||
self.player.preload(id);
|
||||
if let Ok(uri) = SpotifyUri::from_uri(&playable.uri()) {
|
||||
debug!("Preloading {uri:?}");
|
||||
self.player.preload(uri);
|
||||
}
|
||||
}
|
||||
Some(WorkerCommand::Shutdown) => {
|
||||
|
||||
Reference in New Issue
Block a user