Skip to content

Commit

Permalink
chore(dependencies): bump librespot from 0.1.0 to 0.1.1
Browse files Browse the repository at this point in the history
This PR bumps the version of librespot to include PR 427, which improved the error handling on connection loss. Due to librespot API changes, a new field has been added as well.
  • Loading branch information
jb55 committed Feb 11, 2020
1 parent 5568f7f commit 2b91a0c
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 32 deletions.
71 changes: 40 additions & 31 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ tokio-io = "0.1"
tokio-signal = "0.1"
url = "1.7"
xdg = "2.2"
librespot = { version = "0.1", default-features = false, features = ["with-tremor"] }
librespot = { version = "0.1.1", default-features = false, features = ["with-tremor"] }

[target."cfg(target_os = \"macos\")".dependencies]
whoami = "0.7.0"
Expand Down
9 changes: 9 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,11 @@ pub struct SharedConfigValues {
/// The device type shown to clients
#[structopt(long, possible_values = &DEVICETYPE_VALUES, value_name = "string")]
device_type: Option<DeviceType>,

/// Autoplay on connect
#[structopt(long)]
#[serde(default, deserialize_with = "de_from_str")]
autoplay: bool,
}

#[derive(Debug, Default, Deserialize)]
Expand Down Expand Up @@ -577,6 +582,7 @@ pub(crate) struct SpotifydConfig {
pub(crate) shell: String,
pub(crate) zeroconf_port: Option<u16>,
pub(crate) device_type: String,
pub(crate) autoplay: bool,
}

pub(crate) fn get_internal_config(config: CliConfig) -> SpotifydConfig {
Expand Down Expand Up @@ -616,6 +622,8 @@ pub(crate) fn get_internal_config(config: CliConfig) -> SpotifydConfig {

let normalisation_pregain = config.shared_config.normalisation_pregain.unwrap_or(0.0f32);

let autoplay = config.shared_config.autoplay;

let device_type = config
.shared_config
.device_type
Expand Down Expand Up @@ -689,6 +697,7 @@ pub(crate) fn get_internal_config(config: CliConfig) -> SpotifydConfig {
shell,
zeroconf_port: config.shared_config.zeroconf_port,
device_type,
autoplay,
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/main_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ pub(crate) struct MainLoopState {
pub(crate) player_config: PlayerConfig,
pub(crate) session_config: SessionConfig,
pub(crate) handle: Handle,
pub(crate) autoplay: bool,
pub(crate) linear_volume: bool,
pub(crate) running_event_program: Option<Child>,
pub(crate) shell: String,
Expand Down Expand Up @@ -165,6 +166,7 @@ impl Future for MainLoopState {

let (spirc, spirc_task) = Spirc::new(
ConnectConfig {
autoplay: self.autoplay,
name: self.spotifyd_state.device_name.clone(),
device_type: self.device_type,
volume: mixer.volume(),
Expand Down
3 changes: 3 additions & 0 deletions src/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ pub(crate) fn initial_state(
let player_config = config.player_config;
let session_config = config.session_config;
let backend = config.backend.clone();
let autoplay = config.autoplay;
let device_id = session_config.device_id.clone();

#[cfg(feature = "alsa_backend")]
Expand All @@ -92,6 +93,7 @@ pub(crate) fn initial_state(
let discovery_stream = discovery(
&handle,
ConnectConfig {
autoplay,
name: config.device_name.clone(),
device_type,
volume: mixer().volume(),
Expand Down Expand Up @@ -161,6 +163,7 @@ pub(crate) fn initial_state(
running_event_program: None,
shell: config.shell,
device_type,
autoplay,
}
}

Expand Down

0 comments on commit 2b91a0c

Please sign in to comment.