Code formatting
Some checks failed
Rust Build / Check (pull_request) Failing after 34s
Rust Build / Test Suite (pull_request) Failing after 36s
Rust Build / Rustfmt (pull_request) Successful in 27s
Rust Build / Clippy (pull_request) Failing after 38s
Rust Build / build (pull_request) Failing after 41s
Some checks failed
Rust Build / Check (pull_request) Failing after 34s
Rust Build / Test Suite (pull_request) Failing after 36s
Rust Build / Rustfmt (pull_request) Successful in 27s
Rust Build / Clippy (pull_request) Failing after 38s
Rust Build / build (pull_request) Failing after 41s
This commit is contained in:
17
src/main.rs
17
src/main.rs
@@ -24,7 +24,12 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
||||
// TODO: Do something with the result later
|
||||
match some_work(&app_base_url, &song_queue_id).await {
|
||||
Ok((song, coverart, (song_queue_id, song_queue_path), (coverart_queue_id, coverart_queue_path))) => {
|
||||
Ok((
|
||||
song,
|
||||
coverart,
|
||||
(song_queue_id, song_queue_path),
|
||||
(coverart_queue_id, coverart_queue_path),
|
||||
)) => {
|
||||
// TODO: Wipe data from song and coverart queues
|
||||
// TODO: Cleanup files in local filesystem
|
||||
}
|
||||
@@ -72,7 +77,15 @@ async fn is_queue_empty(
|
||||
async fn some_work(
|
||||
app_base_url: &String,
|
||||
song_queue_id: &uuid::Uuid,
|
||||
) -> Result<(icarus_models::song::Song, icarus_models::coverart::CoverArt, (uuid::Uuid, String), (uuid::Uuid, String)), std::io::Error> {
|
||||
) -> Result<
|
||||
(
|
||||
icarus_models::song::Song,
|
||||
icarus_models::coverart::CoverArt,
|
||||
(uuid::Uuid, String),
|
||||
(uuid::Uuid, String),
|
||||
),
|
||||
std::io::Error,
|
||||
> {
|
||||
match prep_song(app_base_url, song_queue_id).await {
|
||||
Ok((song_queue_path, coverart_queue_path, metadata, coverart_queue_id)) => {
|
||||
match apply_metadata(&song_queue_path, &coverart_queue_path, &metadata).await {
|
||||
|
@@ -47,7 +47,11 @@ pub mod create_song {
|
||||
// TODO: Create coverart
|
||||
pub mod create_coverart {
|
||||
|
||||
pub async fn create(base_url: &String, song_id: &uuid::Uuid, coverart_queue_id: &uuid::Uuid) -> Result<reqwest::Response, reqwest::Error> {
|
||||
pub async fn create(
|
||||
base_url: &String,
|
||||
song_id: &uuid::Uuid,
|
||||
coverart_queue_id: &uuid::Uuid,
|
||||
) -> Result<reqwest::Response, reqwest::Error> {
|
||||
let client = reqwest::Client::builder().build()?;
|
||||
let url = format!("{base_url}/api/v2/coverart");
|
||||
let payload = get_payload(song_id, coverart_queue_id);
|
||||
|
Reference in New Issue
Block a user