favourites GET implementation (#95)

This commit is contained in:
Tobi Smethurst 2021-07-09 18:32:48 +02:00 committed by GitHub
commit c7da64922f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 491 additions and 127 deletions

View file

@ -23,7 +23,7 @@ func (t *timeline) IndexBefore(statusID string, include bool, amount int) error
grabloop:
for len(filtered) < amount {
statuses, err := t.db.GetStatusesWhereFollowing(t.accountID, "", offsetStatus, "", amount, false)
statuses, err := t.db.GetHomeTimelineForAccount(t.accountID, "", offsetStatus, "", amount, false)
if err != nil {
if _, ok := err.(db.ErrNoEntries); ok {
break grabloop // we just don't have enough statuses left in the db so index what we've got and then bail
@ -58,7 +58,7 @@ func (t *timeline) IndexBehind(statusID string, amount int) error {
grabloop:
for len(filtered) < amount {
statuses, err := t.db.GetStatusesWhereFollowing(t.accountID, offsetStatus, "", "", amount, false)
statuses, err := t.db.GetHomeTimelineForAccount(t.accountID, offsetStatus, "", "", amount, false)
if err != nil {
if _, ok := err.(db.ErrNoEntries); ok {
break grabloop // we just don't have enough statuses left in the db so index what we've got and then bail