🐛 Fixed attachment loading in ListPostV2
This commit is contained in:
parent
515412d663
commit
c51721505f
@ -1,8 +1,8 @@
|
||||
package queries
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/goccy/go-json"
|
||||
|
||||
"git.solsynth.dev/hypernet/interactive/pkg/internal/database"
|
||||
"git.solsynth.dev/hypernet/interactive/pkg/internal/gap"
|
||||
@ -90,10 +90,12 @@ func ListPostV2(tx *gorm.DB, take int, offset int, order any, user *uint) ([]mod
|
||||
var attachmentsRid []string
|
||||
var usersId []uint
|
||||
|
||||
// Scan records that can be load egearly
|
||||
// Scan records that can be load eagerly
|
||||
var bodies []models.PostStoryBody
|
||||
{
|
||||
raw, _ := json.Marshal(posts)
|
||||
raw, _ := json.Marshal(lo.Map(posts, func(item models.Post, _ int) map[string]any {
|
||||
return item.Body
|
||||
}))
|
||||
json.Unmarshal(raw, &bodies)
|
||||
}
|
||||
for idx, info := range posts {
|
||||
|
@ -14,8 +14,8 @@ print_routes = false
|
||||
[security]
|
||||
internal_public_key = "keys/internal_public_key.pem"
|
||||
|
||||
[[fediverse.friends]]
|
||||
id = "mastodon-social"
|
||||
url = "https://mastodon.social"
|
||||
type = "mastodon"
|
||||
batch_size = 50
|
||||
#[[fediverse.friends]]
|
||||
#id = "mastodon-social"
|
||||
#url = "https://mastodon.social"
|
||||
#type = "mastodon"
|
||||
#batch_size = 50
|
||||
|
Loading…
x
Reference in New Issue
Block a user