Improved auth stability
This commit is contained in:
Generated
+1
-1
@@ -1180,7 +1180,7 @@ checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c"
|
||||
|
||||
[[package]]
|
||||
name = "furumi_tui"
|
||||
version = "0.1.3"
|
||||
version = "0.1.4"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"arboard",
|
||||
|
||||
@@ -58,6 +58,13 @@ pub fn now_epoch_seconds() -> i64 {
|
||||
.unwrap_or(0)
|
||||
}
|
||||
|
||||
pub fn now_epoch_millis() -> i64 {
|
||||
SystemTime::now()
|
||||
.duration_since(UNIX_EPOCH)
|
||||
.map(|d| d.as_millis() as i64)
|
||||
.unwrap_or(0)
|
||||
}
|
||||
|
||||
pub fn session_path() -> Option<PathBuf> {
|
||||
crate::config::project_dirs().map(|dirs| dirs.config_dir().join("credentials.json"))
|
||||
}
|
||||
|
||||
+2
-1
@@ -403,7 +403,7 @@ fn device_playback_state(state: &AppState) -> Option<crate::api::models::DeviceP
|
||||
shuffle: player.shuffle,
|
||||
repeat_mode: player.repeat.label().to_string(),
|
||||
volume: f64::from(player.volume) / 100.0,
|
||||
updated_at_ms: 0,
|
||||
updated_at_ms: auth::now_epoch_millis(),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -752,6 +752,7 @@ fn resume_current_audio(state: &mut AppState, runtime: &mut Runtime) {
|
||||
position_secs,
|
||||
"reopening playback stream after a long pause"
|
||||
);
|
||||
runtime.player.stop();
|
||||
start_current_audio(state, runtime, position_secs, false);
|
||||
} else {
|
||||
runtime.player.resume();
|
||||
|
||||
+1
-1
@@ -252,7 +252,7 @@ fn handle(
|
||||
}
|
||||
}
|
||||
Command::Stop => {
|
||||
if let Some(out) = output {
|
||||
if let Some(out) = output.take() {
|
||||
out.player.stop();
|
||||
}
|
||||
*track_loaded = false;
|
||||
|
||||
Reference in New Issue
Block a user