Downgrade to librespot 0.4.2 for Cargo publish

This commit is contained in:
2024-10-05 13:07:04 -05:00
parent b63e033234
commit c04dd7f6d9
3 changed files with 224 additions and 1626 deletions

1841
Cargo.lock generated
View File

File diff suppressed because it is too large Load Diff

View File

@@ -10,8 +10,8 @@ repository = "https://github.com/Xevion/spotify-quickauth"
license = "MIT OR Apache-2.0"
[dependencies]
librespot-discovery = { git = "https://github.com/librespot-org/librespot", branch = "dev", version = "0.5.0-dev" }
librespot-core = { git = "https://github.com/librespot-org/librespot", branch = "dev", version = "0.5.0-dev" }
librespot-discovery = { version = "0.4.2" }
librespot-core = { version = "0.4.2" }
serde = { version = "1.0.210", features = ["derive"] }
tokio = { version = "1.40.0", features = ["full"] }
futures = "0.3.30"

View File

@@ -5,7 +5,6 @@ use librespot_core::config::DeviceType;
use librespot_discovery::Discovery;
use log::{info, warn};
use sha1::{Digest, Sha1};
use librespot_core::SessionConfig;
use std::io::Write;
#[tokio::main(flavor = "current_thread")]
@@ -42,7 +41,7 @@ async fn main() {
let device_id = hex::encode(Sha1::digest(device_name.as_bytes()));
let device_type = DeviceType::Computer;
let mut server = Discovery::builder(device_id, SessionConfig::default().client_id)
let mut server = Discovery::builder(device_id)
.name(device_name.clone())
.device_type(device_type)
.launch()
@@ -52,7 +51,7 @@ async fn main() {
let mut written = false;
while let Some(credentials) = server.next().await {
let result = File::create(&credentials_file).and_then(|mut file| {
let result = File::create("./credentials.json").and_then(|mut file| {
let data = serde_json::to_string(&credentials)?;
write!(file, "{data}")
});