rave/src/rest/ping.rs
Lyssieth 453a496377
feat: we can now do things
The most crappy basic implementation, but:
- It can list albums
- It can list a single album's tracks
- It can play a song

Closes #1
2023-10-09 15:49:33 +03:00

14 lines
377 B
Rust

use poem::web::Data;
use sqlx::SqlitePool;
use crate::{authentication::Authentication, subsonic::SubsonicResponse, utils};
#[poem::handler]
pub async fn ping(Data(pool): Data<&SqlitePool>, auth: Authentication) -> SubsonicResponse {
let u = utils::verify_user(pool, auth).await;
match u {
Ok(_) => SubsonicResponse::new_empty(),
Err(e) => e,
}
}