mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 19:12:25 -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.
|
// Public only.
|
||||||
q = q.Where("? = ?", bun.Ident("visibility"), gtsmodel.VisibilityPublic)
|
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.
|
// Only include statuses that aren't pending approval.
|
||||||
q = q.Where("? = ?", bun.Ident("pending_approval"), false)
|
q = q.Where("? = ?", bun.Ident("pending_approval"), false)
|
||||||
|
|
||||||
|
// Ignore boosts.
|
||||||
|
q = q.Where("? IS NULL", bun.Ident("boost_of_id"))
|
||||||
|
|
||||||
return q, nil
|
return q, nil
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
@ -332,6 +332,13 @@ func loadStatusTimelinePage(
|
||||||
Table("statuses").
|
Table("statuses").
|
||||||
Column("id")
|
Column("id")
|
||||||
|
|
||||||
|
// Append caller
|
||||||
|
// query details.
|
||||||
|
q, err := query(q)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
if maxID != "" {
|
if maxID != "" {
|
||||||
// Set a maximum ID boundary if was given.
|
// Set a maximum ID boundary if was given.
|
||||||
q = q.Where("? < ?", bun.Ident("id"), maxID)
|
q = q.Where("? < ?", bun.Ident("id"), maxID)
|
||||||
|
|
@ -342,13 +349,6 @@ func loadStatusTimelinePage(
|
||||||
q = q.Where("? > ?", bun.Ident("id"), minID)
|
q = q.Where("? > ?", bun.Ident("id"), minID)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Append caller
|
|
||||||
// query details.
|
|
||||||
q, err := query(q)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set query ordering.
|
// Set query ordering.
|
||||||
if order.Ascending() {
|
if order.Ascending() {
|
||||||
q = q.OrderExpr("? ASC", bun.Ident("id"))
|
q = q.OrderExpr("? ASC", bun.Ident("id"))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue