mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-05 13:08:07 -06:00
[feature] do not uncache status / emoji media if attached status is bookmarked (#2956)
* do not uncache status / emoji media if attached status is bookmarked
* add status bookmark and bookmark IDs caches
* update status bookmark tests
* move IsStatusBookmarkedBy() to StatusBookmark{} interface, rely on cache
* fix envparsing.sh test
This commit is contained in:
parent
6f26b32ec3
commit
5dcc954072
17 changed files with 501 additions and 215 deletions
|
|
@ -677,12 +677,3 @@ func (s *statusDB) getStatusBoostIDs(ctx context.Context, statusID string) ([]st
|
|||
return statusIDs, nil
|
||||
})
|
||||
}
|
||||
|
||||
func (s *statusDB) IsStatusBookmarkedBy(ctx context.Context, status *gtsmodel.Status, accountID string) (bool, error) {
|
||||
q := s.db.
|
||||
NewSelect().
|
||||
TableExpr("? AS ?", bun.Ident("status_bookmarks"), bun.Ident("status_bookmark")).
|
||||
Where("? = ?", bun.Ident("status_bookmark.status_id"), status.ID).
|
||||
Where("? = ?", bun.Ident("status_bookmark.account_id"), accountID)
|
||||
return exists(ctx, q)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue