tsk-62: Code formatting
Some checks failed
Rust Build / Check (pull_request) Successful in 46s
Rust Build / Test Suite (pull_request) Successful in 40s
Rust Build / Rustfmt (pull_request) Successful in 33s
Rust Build / Clippy (pull_request) Failing after 46s
Rust Build / build (pull_request) Successful in 43s
Some checks failed
Rust Build / Check (pull_request) Successful in 46s
Rust Build / Test Suite (pull_request) Successful in 40s
Rust Build / Rustfmt (pull_request) Successful in 33s
Rust Build / Clippy (pull_request) Failing after 46s
Rust Build / build (pull_request) Successful in 43s
This commit is contained in:
@@ -307,7 +307,7 @@ pub mod wipe_data {
|
||||
pub mod song_queue {
|
||||
pub async fn wipe_data(
|
||||
app: &crate::config::App,
|
||||
queued_song: &crate::queued_item::QueuedSong
|
||||
queued_song: &crate::queued_item::QueuedSong,
|
||||
) -> Result<reqwest::Response, reqwest::Error> {
|
||||
let client = reqwest::Client::builder().build()?;
|
||||
let url = format!("{}/api/v2/song/queue/data/wipe", app.uri);
|
||||
@@ -331,7 +331,7 @@ pub mod wipe_data {
|
||||
pub mod coverart_queue {
|
||||
pub async fn wipe_data(
|
||||
app: &crate::config::App,
|
||||
queued_coverart: &crate::queued_item::QueuedCoverArt
|
||||
queued_coverart: &crate::queued_item::QueuedCoverArt,
|
||||
) -> Result<reqwest::Response, reqwest::Error> {
|
||||
let client = reqwest::Client::builder().build()?;
|
||||
let url = format!("{}/api/v2/coverart/queue/data/wipe", app.uri);
|
||||
|
50
src/main.rs
50
src/main.rs
@@ -65,12 +65,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
coverart,
|
||||
_metadata,
|
||||
queued_song,
|
||||
queued_coverart
|
||||
// (song_queue_id, _song_queue_path),
|
||||
// (coverart_queue_id, _coverart_queue_path),
|
||||
queued_coverart, // (song_queue_id, _song_queue_path),
|
||||
// (coverart_queue_id, _coverart_queue_path),
|
||||
)) => {
|
||||
match wipe_data_from_queues(&app, &queued_song, &queued_coverart)
|
||||
.await
|
||||
match wipe_data_from_queues(&app, &queued_song, &queued_coverart).await
|
||||
{
|
||||
Ok(_) => match cleanup(&song, &coverart).await {
|
||||
Ok(_) => {
|
||||
@@ -106,7 +104,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
async fn wipe_data_from_queues(
|
||||
app: &config::App,
|
||||
queued_song: &crate::queued_item::QueuedSong,
|
||||
queued_coverart: &crate::queued_item::QueuedCoverArt
|
||||
queued_coverart: &crate::queued_item::QueuedCoverArt,
|
||||
) -> Result<(), std::io::Error> {
|
||||
match api::wipe_data::song_queue::wipe_data(app, queued_song).await {
|
||||
Ok(response) => match response
|
||||
@@ -185,7 +183,7 @@ async fn some_work(
|
||||
icarus_models::coverart::CoverArt,
|
||||
api::get_metadata_queue::response::Metadata,
|
||||
queued_item::QueuedSong,
|
||||
queued_item::QueuedCoverArt
|
||||
queued_item::QueuedCoverArt,
|
||||
),
|
||||
std::io::Error,
|
||||
> {
|
||||
@@ -220,15 +218,9 @@ async fn some_work(
|
||||
};
|
||||
*/
|
||||
|
||||
match metadata::apply_metadata(&queued_song, &queued_coverart, &metadata).await
|
||||
{
|
||||
match metadata::apply_metadata(&queued_song, &queued_coverart, &metadata).await {
|
||||
Ok(_applied) => {
|
||||
match api::update_queued_song::update_queued_song(
|
||||
app,
|
||||
&queued_song,
|
||||
)
|
||||
.await
|
||||
{
|
||||
match api::update_queued_song::update_queued_song(app, &queued_song).await {
|
||||
Ok(response) => {
|
||||
match response
|
||||
.json::<api::update_queued_song::response::Response>()
|
||||
@@ -332,20 +324,20 @@ async fn prep_song(
|
||||
};
|
||||
*/
|
||||
|
||||
let queued_song: crate::queued_item::QueuedSong = match song.save_to_filesystem() {
|
||||
Ok(_) => {
|
||||
queued_item::QueuedSong {
|
||||
id: *song_queue_id,
|
||||
song,
|
||||
path: songpath
|
||||
}
|
||||
|
||||
}
|
||||
Err(err) => {
|
||||
eprintln!("Error: {err:?}");
|
||||
queued_item::QueuedSong{..Default::default()}
|
||||
}
|
||||
};
|
||||
let queued_song: crate::queued_item::QueuedSong =
|
||||
match song.save_to_filesystem() {
|
||||
Ok(_) => queued_item::QueuedSong {
|
||||
id: *song_queue_id,
|
||||
song,
|
||||
path: songpath,
|
||||
},
|
||||
Err(err) => {
|
||||
eprintln!("Error: {err:?}");
|
||||
queued_item::QueuedSong {
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
println!("Saved at: {:?}", queued_song.path);
|
||||
|
||||
|
@@ -122,7 +122,10 @@ pub async fn apply_metadata(
|
||||
}
|
||||
}
|
||||
|
||||
match icarus_meta::meta::coverart::set_coverart(&queued_song.path, &queued_coverart.path) {
|
||||
match icarus_meta::meta::coverart::set_coverart(
|
||||
&queued_song.path,
|
||||
&queued_coverart.path,
|
||||
) {
|
||||
Ok(_data) => {
|
||||
if _data.is_empty() {
|
||||
println!("There was an issue");
|
||||
|
Reference in New Issue
Block a user