mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 04:22:24 -05:00
some small re-orderings to confirm query params in correct places
This commit is contained in:
parent
c92bb83298
commit
93ad2850f6
1 changed files with 10 additions and 10 deletions
|
|
@ -162,12 +162,12 @@ func (t *timelineDB) GetLocalTimeline(ctx context.Context, page *paging.Page) ([
|
|||
// Public only.
|
||||
q = q.Where("? = ?", bun.Ident("visibility"), gtsmodel.VisibilityPublic)
|
||||
|
||||
// Ignore boosts.
|
||||
q = q.Where("? IS NULL", bun.Ident("boost_of_id"))
|
||||
|
||||
// Only include statuses that aren't pending approval.
|
||||
q = q.Where("? = ?", bun.Ident("pending_approval"), false)
|
||||
|
||||
// Ignore boosts.
|
||||
q = q.Where("? IS NULL", bun.Ident("boost_of_id"))
|
||||
|
||||
return q, nil
|
||||
},
|
||||
)
|
||||
|
|
@ -332,6 +332,13 @@ func loadStatusTimelinePage(
|
|||
Table("statuses").
|
||||
Column("id")
|
||||
|
||||
// Append caller
|
||||
// query details.
|
||||
q, err := query(q)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if maxID != "" {
|
||||
// Set a maximum ID boundary if was given.
|
||||
q = q.Where("? < ?", bun.Ident("id"), maxID)
|
||||
|
|
@ -342,13 +349,6 @@ func loadStatusTimelinePage(
|
|||
q = q.Where("? > ?", bun.Ident("id"), minID)
|
||||
}
|
||||
|
||||
// Append caller
|
||||
// query details.
|
||||
q, err := query(q)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Set query ordering.
|
||||
if order.Ascending() {
|
||||
q = q.OrderExpr("? ASC", bun.Ident("id"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue