Skip to content

Commit

Permalink
fix: response struct of get genres
Browse files Browse the repository at this point in the history
  • Loading branch information
vnghia committed Apr 6, 2024
1 parent 559cf44 commit 5bfa16c
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/open_subsonic/browsing/get_genres.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,9 @@ use crate::{Database, DatabasePool};
#[derive(Debug)]
pub struct GetGenresParams {}

#[derive(Serialize)]
pub struct Genre {
genre: Vec<GenreId3>,
}

#[derive(Serialize)]
pub struct Genres {
genres: Genre,
genre: Vec<GenreId3>,
}

#[wrap_subsonic_response]
Expand All @@ -45,10 +40,7 @@ pub async fn get_genres_handler(
State(database): State<Database>,
req: GetGenresRequest,
) -> GenresJsonResponse {
GenresBody {
genres: Genres { genres: Genre { genre: get_genres(&database.pool, req.user_id).await? } },
}
.into()
GenresBody { genres: Genres { genre: get_genres(&database.pool, req.user_id).await? } }.into()
}

#[cfg(test)]
Expand Down

0 comments on commit 5bfa16c

Please sign in to comment.