This commit is contained in:
JMARyA 2024-10-07 20:15:37 +02:00
parent 39e2897f0b
commit 8d352838e8
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263

View file

@ -198,8 +198,8 @@ impl Track {
///
/// A vector of `Track` objects representing the latest tracks for the given user.
pub async fn get_latest_of_user(u: &User) -> Vec<Self> {
let ids: Vec<(uuid::Uuid,)> = sqlx::query_as(
"SELECT DISTINCT(track) FROM events WHERE \"user\" = $1 ORDER BY time DESC LIMIT 300",
let ids: Vec<(uuid::Uuid, chrono::DateTime<chrono::Utc>)> = sqlx::query_as(
"SELECT DISTINCT(track), time FROM events WHERE \"user\" = $1 ORDER BY time DESC LIMIT 300",
)
.bind(&u.username)
.fetch_all(get_pg!())