summaryrefslogtreecommitdiff
path: root/src/requests/start.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/requests/start.rs')
-rw-r--r--src/requests/start.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/requests/start.rs b/src/requests/start.rs
index d07177e..3afbe3a 100644
--- a/src/requests/start.rs
+++ b/src/requests/start.rs
@@ -121,12 +121,18 @@ async fn status_socket(
121 } 121 }
122} 122}
123 123
124fn get_eta(msg: &str, uuid: &str) -> Result<u64, Error> { 124fn get_eta(msg: &str, uuid: &str) -> Result<String, Error> {
125 let spl: Vec<&str> = msg.split('_').collect(); 125 let spl: Vec<&str> = msg.split('_').collect();
126 if (spl[0] != "eta") || (spl[2] != uuid) { 126 if (spl[0] != "eta") || (spl[2] != uuid) {
127 return Err(Error::WsResponse); 127 return Err(Error::WsResponse);
128 }; 128 };
129 Ok(spl[1].parse()?) 129 let input: u64 = spl[1].parse()?;
130
131 let sec = input % 60;
132 let min = (input / 60) % 60;
133 let hou = (input / (60 * 60)) % 60;
134
135 Ok(format!("{hou:0>2}:{min:0>2}:{sec:0>2}"))
130} 136}
131 137
132fn verify_response(res: &str, org_uuid: &str) -> Result<Verified, Error> { 138fn verify_response(res: &str, org_uuid: &str) -> Result<Verified, Error> {