Compare commits
No commits in common. "029e45aee8d3d87cc4b9775404513744ddf50d55" and "7961a79751ae7b2ac4cc0e96cc8760ffd62a5543" have entirely different histories.
029e45aee8
...
7961a79751
589
Cargo.lock
generated
589
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
12
Cargo.toml
12
Cargo.toml
@ -5,7 +5,7 @@ edition = "2021"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
axum = {version = "0.6", features = ["ws", "headers"]}
|
axum = {version = "0.6", features = ["ws", "headers"]}
|
||||||
axum-server = {version = "0.5", features = ["tls-rustls"]}
|
axum-server = {version = "0.4", features = ["tls-rustls"]}
|
||||||
tokio = {version = "1", features = ["rt-multi-thread"]}
|
tokio = {version = "1", features = ["rt-multi-thread"]}
|
||||||
dotenvy = "0.15"
|
dotenvy = "0.15"
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
@ -13,13 +13,13 @@ tracing-subscriber = {version = "0.3", features = ["env-filter"]}
|
|||||||
tower-http = {version = "0.4", features = ["trace", "cors", "sensitive-headers", "request-id"]}
|
tower-http = {version = "0.4", features = ["trace", "cors", "sensitive-headers", "request-id"]}
|
||||||
hyper = {version = "0.14", features = ["client"]}
|
hyper = {version = "0.14", features = ["client"]}
|
||||||
http = "0.2"
|
http = "0.2"
|
||||||
async-tungstenite = {version = "0.23", features = ["tokio-runtime"]}
|
async-tungstenite = {version = "0.21", features = ["tokio-runtime"]}
|
||||||
axum-tungstenite = {package = "tungstenite", version = "0.20"}
|
axum-tungstenite = {package = "tungstenite", version = "0.18"}
|
||||||
futures = {version = "0.3"}
|
futures = {version = "0.3"}
|
||||||
serde = {version = "1", features = ["derive"]}
|
serde = {version = "1", features = ["derive"]}
|
||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
rust-argon2 = "2.0"
|
rust-argon2 = "1.0"
|
||||||
rand = "0.8"
|
rand = "0.8"
|
||||||
scc = "2"
|
scc = "1"
|
||||||
base64 = "0.21"
|
base64 = "0.21"
|
||||||
serde_qs = "0.12"
|
serde_qs = "0.12"
|
15
src/state.rs
15
src/state.rs
@ -53,20 +53,13 @@ impl AppStateInternal {
|
|||||||
let tokens_path = get_conf("TOKENS_FILE")?;
|
let tokens_path = get_conf("TOKENS_FILE")?;
|
||||||
|
|
||||||
let music_info = MusicInfoMap::new();
|
let music_info = MusicInfoMap::new();
|
||||||
let fetch_music_info = || {
|
music_info
|
||||||
music_info.read(
|
.read(
|
||||||
&musikcubed_password,
|
musikcubed_password.clone(),
|
||||||
&musikcubed_address,
|
&musikcubed_address,
|
||||||
musikcubed_metadata_port,
|
musikcubed_metadata_port,
|
||||||
)
|
)
|
||||||
};
|
.await?;
|
||||||
let mut result = fetch_music_info().await;
|
|
||||||
while let Err(err) = result {
|
|
||||||
tracing::error!("error while trying to fetch music metadata from musikcubed: {err}");
|
|
||||||
tracing::info!("trying again in 5 seconds...");
|
|
||||||
tokio::time::sleep(std::time::Duration::from_secs(5)).await;
|
|
||||||
result = fetch_music_info().await;
|
|
||||||
}
|
|
||||||
|
|
||||||
let this = Self {
|
let this = Self {
|
||||||
client: Client::new(),
|
client: Client::new(),
|
||||||
|
@ -56,7 +56,7 @@ impl Tokens {
|
|||||||
pub async fn write(&self, path: impl AsRef<Path>) -> Result<(), AppError> {
|
pub async fn write(&self, path: impl AsRef<Path>) -> Result<(), AppError> {
|
||||||
let mut contents = String::new();
|
let mut contents = String::new();
|
||||||
self.hashed
|
self.hashed
|
||||||
.scan_async(|hash| {
|
.for_each_async(|hash| {
|
||||||
writeln!(&mut contents, "{hash}").expect("if this fails then too bad")
|
writeln!(&mut contents, "{hash}").expect("if this fails then too bad")
|
||||||
})
|
})
|
||||||
.await;
|
.await;
|
||||||
|
Loading…
Reference in New Issue
Block a user