fix: duplicated posts in all timeline
This commit is contained in:
parent
1dc0611298
commit
e5b6b5a4d4
9 changed files with 34 additions and 43 deletions
|
@ -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) => {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -157,6 +157,8 @@ pub async fn render_error(
|
|||
pub struct PaginatedQuery {
|
||||
#[serde(default)]
|
||||
pub page: usize,
|
||||
#[serde(default)]
|
||||
pub before: usize,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue