2023-10-08 20:11:59 +00:00
|
|
|
use poem::web::Data;
|
|
|
|
|
use sqlx::SqlitePool;
|
|
|
|
|
|
2023-10-09 12:49:33 +00:00
|
|
|
use crate::{authentication::Authentication, subsonic::SubsonicResponse, utils};
|
2023-10-08 19:53:42 +00:00
|
|
|
|
|
|
|
|
#[poem::handler]
|
2023-10-08 20:11:59 +00:00
|
|
|
pub async fn ping(Data(pool): Data<&SqlitePool>, auth: Authentication) -> SubsonicResponse {
|
2023-10-09 12:49:33 +00:00
|
|
|
let u = utils::verify_user(pool, auth).await;
|
2023-10-08 19:53:42 +00:00
|
|
|
|
2023-10-09 12:49:33 +00:00
|
|
|
match u {
|
|
|
|
|
Ok(_) => SubsonicResponse::new_empty(),
|
|
|
|
|
Err(e) => e,
|
2023-10-08 20:11:59 +00:00
|
|
|
}
|
2023-10-08 19:53:42 +00:00
|
|
|
}
|