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

This commit is contained in:
2025-10-22 13:22:06 -04:00
parent a08246efd2
commit 05e772068c
3 changed files with 27 additions and 32 deletions

View File

@@ -307,7 +307,7 @@ pub mod wipe_data {
pub mod song_queue { pub mod song_queue {
pub async fn wipe_data( pub async fn wipe_data(
app: &crate::config::App, app: &crate::config::App,
queued_song: &crate::queued_item::QueuedSong queued_song: &crate::queued_item::QueuedSong,
) -> Result<reqwest::Response, reqwest::Error> { ) -> Result<reqwest::Response, reqwest::Error> {
let client = reqwest::Client::builder().build()?; let client = reqwest::Client::builder().build()?;
let url = format!("{}/api/v2/song/queue/data/wipe", app.uri); let url = format!("{}/api/v2/song/queue/data/wipe", app.uri);
@@ -331,7 +331,7 @@ pub mod wipe_data {
pub mod coverart_queue { pub mod coverart_queue {
pub async fn wipe_data( pub async fn wipe_data(
app: &crate::config::App, app: &crate::config::App,
queued_coverart: &crate::queued_item::QueuedCoverArt queued_coverart: &crate::queued_item::QueuedCoverArt,
) -> Result<reqwest::Response, reqwest::Error> { ) -> Result<reqwest::Response, reqwest::Error> {
let client = reqwest::Client::builder().build()?; let client = reqwest::Client::builder().build()?;
let url = format!("{}/api/v2/coverart/queue/data/wipe", app.uri); let url = format!("{}/api/v2/coverart/queue/data/wipe", app.uri);

View File

@@ -65,12 +65,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
coverart, coverart,
_metadata, _metadata,
queued_song, queued_song,
queued_coverart queued_coverart, // (song_queue_id, _song_queue_path),
// (song_queue_id, _song_queue_path), // (coverart_queue_id, _coverart_queue_path),
// (coverart_queue_id, _coverart_queue_path),
)) => { )) => {
match wipe_data_from_queues(&app, &queued_song, &queued_coverart) match wipe_data_from_queues(&app, &queued_song, &queued_coverart).await
.await
{ {
Ok(_) => match cleanup(&song, &coverart).await { Ok(_) => match cleanup(&song, &coverart).await {
Ok(_) => { Ok(_) => {
@@ -106,7 +104,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
async fn wipe_data_from_queues( async fn wipe_data_from_queues(
app: &config::App, app: &config::App,
queued_song: &crate::queued_item::QueuedSong, queued_song: &crate::queued_item::QueuedSong,
queued_coverart: &crate::queued_item::QueuedCoverArt queued_coverart: &crate::queued_item::QueuedCoverArt,
) -> Result<(), std::io::Error> { ) -> Result<(), std::io::Error> {
match api::wipe_data::song_queue::wipe_data(app, queued_song).await { match api::wipe_data::song_queue::wipe_data(app, queued_song).await {
Ok(response) => match response Ok(response) => match response
@@ -185,7 +183,7 @@ async fn some_work(
icarus_models::coverart::CoverArt, icarus_models::coverart::CoverArt,
api::get_metadata_queue::response::Metadata, api::get_metadata_queue::response::Metadata,
queued_item::QueuedSong, queued_item::QueuedSong,
queued_item::QueuedCoverArt queued_item::QueuedCoverArt,
), ),
std::io::Error, 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) => { Ok(_applied) => {
match api::update_queued_song::update_queued_song( match api::update_queued_song::update_queued_song(app, &queued_song).await {
app,
&queued_song,
)
.await
{
Ok(response) => { Ok(response) => {
match response match response
.json::<api::update_queued_song::response::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() { let queued_song: crate::queued_item::QueuedSong =
Ok(_) => { match song.save_to_filesystem() {
queued_item::QueuedSong { Ok(_) => queued_item::QueuedSong {
id: *song_queue_id, id: *song_queue_id,
song, song,
path: songpath path: songpath,
} },
Err(err) => {
} eprintln!("Error: {err:?}");
Err(err) => { queued_item::QueuedSong {
eprintln!("Error: {err:?}"); ..Default::default()
queued_item::QueuedSong{..Default::default()} }
} }
}; };
println!("Saved at: {:?}", queued_song.path); println!("Saved at: {:?}", queued_song.path);

View File

@@ -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) => { Ok(_data) => {
if _data.is_empty() { if _data.is_empty() {
println!("There was an issue"); println!("There was an issue");