fix: duplicated posts in all timeline

This commit is contained in:
trisua 2025-07-04 17:41:58 -04:00
parent 1dc0611298
commit e5b6b5a4d4
9 changed files with 34 additions and 43 deletions

View file

@ -838,7 +838,7 @@ pub async fn all_request(
};
match data
.get_latest_posts(12, props.page, &Some(user.clone()))
.get_latest_posts(12, props.page, &Some(user.clone()), props.before)
.await
{
Ok(posts) => {

View file

@ -631,6 +631,8 @@ pub struct TimelineQuery {
pub tag: String,
#[serde(default)]
pub paginated: bool,
#[serde(default)]
pub before: usize,
}
/// `/_swiss_army_timeline`
@ -688,7 +690,9 @@ pub async fn swiss_army_timeline_request(
// everything else
match req.tl {
DefaultTimelineChoice::AllPosts => {
data.0.get_latest_posts(12, req.page, &user).await
data.0
.get_latest_posts(12, req.page, &user, req.before)
.await
}
DefaultTimelineChoice::PopularPosts => {
data.0.get_popular_posts(12, req.page, 604_800_000).await

View file

@ -157,6 +157,8 @@ pub async fn render_error(
pub struct PaginatedQuery {
#[serde(default)]
pub page: usize,
#[serde(default)]
pub before: usize,
}
#[derive(Deserialize)]