Skip to content

Commit

Permalink
fix spotify connect deviceid (#336)
Browse files Browse the repository at this point in the history
This commit fixes a bug where running multiple daemons on the same account wouldn\'t work as each of them is externally seen as the same device by spotify's connect api. The reason was that the deviceid was static within the code instead of using the device_name property.
  • Loading branch information
Sven Lechner authored Sep 26, 2019
1 parent 4f3e4cd commit 813739d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,8 @@ pub(crate) fn get_internal_config(config: CliConfig) -> SpotifydConfig {
.device_name
.unwrap_or_else(|| format!("{}@{}", "Spotifyd", gethostname().to_string_lossy()));

let device_id = device_id(&device_name);

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

let pid = config
Expand Down Expand Up @@ -520,7 +522,7 @@ pub(crate) fn get_internal_config(config: CliConfig) -> SpotifydConfig {
},
session_config: SessionConfig {
user_agent: version::version_string(),
device_id: device_id("Spotifyd"),
device_id,
proxy: None,
ap_port: Some(443),
},
Expand Down

0 comments on commit 813739d

Please sign in to comment.