From 70d45e42a8e7e80533a5647c0d19cb0bfc08e3a1 Mon Sep 17 00:00:00 2001 From: JMARyA Date: Mon, 7 Oct 2024 15:36:08 +0200 Subject: [PATCH] idk --- src/library/track.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/library/track.rs b/src/library/track.rs index 0127741..2e580cd 100644 --- a/src/library/track.rs +++ b/src/library/track.rs @@ -198,7 +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 { - let res: Vec<(uuid::Uuid, String, String, chrono::DateTime, Option, Option, Option, chrono::DateTime)> = sqlx::query_as("SELECT DISTINCT(t.*), e.time FROM track t JOIN events e ON t.id = e.track WHERE e.user = $1 ORDER BY e.time DESC") + // todo : weird + let res: Vec<(uuid::Uuid, String, String, chrono::DateTime, Option, Option, Option, chrono::DateTime)> = sqlx::query_as("SELECT DISTINCT(t.*), e.time FROM track t JOIN events e ON t.id = e.track WHERE e.user = $1 ORDER BY e.time DESC LIMIT 300") .bind(&u.username) .fetch_all(get_pg!()) .await