Reorganizing metadata queue code (#144)

* Reorganizing metadata queue code

* Function name change

* Test payload changes

* function parameter name change
This commit was merged in pull request #144.
This commit is contained in:
KD
2025-06-18 19:47:41 -04:00
committed by GitHub
parent fa792be9cc
commit fbec3305b1
2 changed files with 70 additions and 62 deletions
+20 -18
View File
@@ -325,9 +325,9 @@ mod tests {
async fn queue_metadata_req(
app: &axum::Router,
id: &uuid::Uuid,
song_queue_id: &uuid::Uuid,
) -> Result<axum::response::Response, std::convert::Infallible> {
let payload = payload_data(&id).await;
let payload = payload_data::queue_metadata_payload_data(&song_queue_id).await;
let req = axum::http::Request::builder()
.method(axum::http::Method::POST)
@@ -600,22 +600,24 @@ mod tests {
serde_json::from_slice(&body).unwrap()
}
pub async fn payload_data(id: &uuid::Uuid) -> serde_json::Value {
serde_json::json!(
{
"id": id,
"album" : "Machine Gun: The FillMore East First Show",
"album_artist" : "Jimi Hendrix",
"artist" : "Jimi Hendrix",
"disc" : 1,
"disc_count" : 1,
"duration" : 330,
"genre" : "Psychadelic Rock",
"title" : "Power of Soul",
"track" : 1,
"track_count" : 11,
"year" : 2016
})
pub mod payload_data {
pub async fn queue_metadata_payload_data(song_queue_id: &uuid::Uuid) -> serde_json::Value {
serde_json::json!(
{
"song_queue_id": song_queue_id,
"album" : "Machine Gun: The FillMore East First Show",
"album_artist" : "Jimi Hendrix",
"artist" : "Jimi Hendrix",
"disc" : 1,
"disc_count" : 1,
"duration" : 330,
"genre" : "Psychadelic Rock",
"title" : "Power of Soul",
"track" : 1,
"track_count" : 11,
"year" : 2016
})
}
}
#[tokio::test]