Skip to content

Commit

Permalink
change getsong to only return song
Browse files Browse the repository at this point in the history
  • Loading branch information
Nils Fahle committed Jun 5, 2023
1 parent 7b7bc6c commit db5b153
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ async fn verify_access_key(uuid: &str, api_key: &str, pool: &State<Pool<MySql>>)
}

#[get("/getsong.php?<uuid>")]
async fn get_song(pool: &State<Pool<MySql>>, uuid: &str) -> Result<Json<Song>, Status> {
Song::get_song(uuid.to_string(), pool).await.map_or(Err(Status::InternalServerError), |song| Ok(Json(song)))
async fn get_song(pool: &State<Pool<MySql>>, uuid: &str) -> Result<String, Status> {
Song::get_song(uuid.to_string(), pool).await.map_or(Err(Status::InternalServerError), |song| Ok(song.song))
}

#[get("/queue.php?<uuid>")]
Expand Down

0 comments on commit db5b153

Please sign in to comment.