Code formatting
All checks were successful
Rust Build / Check (pull_request) Successful in 35s
Rust Build / Test Suite (pull_request) Successful in 31s
Rust Build / Rustfmt (pull_request) Successful in 29s
Rust Build / Clippy (pull_request) Successful in 31s
Rust Build / build (pull_request) Successful in 46s
All checks were successful
Rust Build / Check (pull_request) Successful in 35s
Rust Build / Test Suite (pull_request) Successful in 31s
Rust Build / Rustfmt (pull_request) Successful in 29s
Rust Build / Clippy (pull_request) Successful in 31s
Rust Build / build (pull_request) Successful in 46s
This commit is contained in:
14
src/main.rs
14
src/main.rs
@@ -107,20 +107,20 @@ async fn wipe_data_from_queues(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn cleanup(song_queue_path: &String, coverart_queue_path: &String) -> Result<(), std::io::Error> {
|
async fn cleanup(
|
||||||
|
song_queue_path: &String,
|
||||||
|
coverart_queue_path: &String,
|
||||||
|
) -> Result<(), std::io::Error> {
|
||||||
match the_rest::cleanup::clean_song_queue(song_queue_path) {
|
match the_rest::cleanup::clean_song_queue(song_queue_path) {
|
||||||
Ok(_) => {
|
Ok(_) => {}
|
||||||
}
|
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
eprintln!("Error: Problem cleaning up SongQueue files {err:?}");
|
eprintln!("Error: Problem cleaning up SongQueue files {err:?}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
match the_rest::cleanup::clean_coverart_queue(coverart_queue_path) {
|
match the_rest::cleanup::clean_coverart_queue(coverart_queue_path) {
|
||||||
Ok(_) => {
|
Ok(_) => Ok(()),
|
||||||
Ok(())
|
Err(err) => Err(err),
|
||||||
}
|
|
||||||
Err(err) => Err(err)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -131,15 +131,19 @@ pub mod cleanup {
|
|||||||
match std::fs::remove_file(file_path) {
|
match std::fs::remove_file(file_path) {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
if check_file_existence(song_queue_path) {
|
if check_file_existence(song_queue_path) {
|
||||||
Err(std::io::Error::other(String::from("SongQueue file exists after a deletion")))
|
Err(std::io::Error::other(String::from(
|
||||||
|
"SongQueue file exists after a deletion",
|
||||||
|
)))
|
||||||
} else {
|
} else {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
Err(err) => Err(std::io::Error::other(err.to_string()))
|
Err(err) => Err(std::io::Error::other(err.to_string())),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Err(std::io::Error::other(String::from("SongQueue file path does not exists")))
|
Err(std::io::Error::other(String::from(
|
||||||
|
"SongQueue file path does not exists",
|
||||||
|
)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,15 +155,17 @@ pub mod cleanup {
|
|||||||
if !check_file_existence(coverart_queue_path) {
|
if !check_file_existence(coverart_queue_path) {
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
Err(std::io::Error::other(String::from("CoverArt file stil exists")))
|
Err(std::io::Error::other(String::from(
|
||||||
|
"CoverArt file stil exists",
|
||||||
|
)))
|
||||||
}
|
}
|
||||||
},
|
|
||||||
Err(err) => {
|
|
||||||
Err(std::io::Error::other(err.to_string()))
|
|
||||||
}
|
}
|
||||||
|
Err(err) => Err(std::io::Error::other(err.to_string())),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Err(std::io::Error::other(String::from("CoverArt file does not exists")))
|
Err(std::io::Error::other(String::from(
|
||||||
|
"CoverArt file does not exists",
|
||||||
|
)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user