Cleanup upload module

Signed-off-by: Serial <69764315+Serial-ATA@users.noreply.github.com>
This commit is contained in:
Serial committed 2022-03-22 17:49:27 -04:00
1 parent 625248fbc6
commit f6edb983d3
1 file changed
+3 -5
+3 -5
View File
@@ -21,13 +21,11 @@ pub fn stop_mixer(lms: &String) {
"{\"id\":1, \"method\":\"slim.request\",\"params\":[\"\",[\"blissmixer\",\"stop\"]]}";
log::info!("Asking plugin to stop mixer");
match ureq::post(&format!("http://{}:9000/jsonrpc.js", lms)).send_string(&stop_req) {
Ok(_) => {}
Err(e) => {
let req = ureq::post(&format!("http://{}:9000/jsonrpc.js", lms)).send_string(&stop_req);
if let Err(e) = req {
log::error!("Failed to ask plugin to stop mixer. {}", e);
}
}
}
pub fn upload_db(db_path: &String, lms: &String) {
// First tell LMS to restart the mixer in upload mode
@@ -70,7 +68,7 @@ pub fn upload_db(db_path: &String, lms: &String) {
}
}
if port <= 0 {
if port == 0 {
fail("Invalid port");
}