1
0
mirror of https://github.com/mrusme/neonmodem.git synced 2024-12-04 14:46:37 -05:00

Tried debugging Lemmy comments issue

https://github.com/Arsen6331/go-lemmy/issues/1
This commit is contained in:
マリウス 2022-12-31 00:39:34 -05:00
parent 9c50ddffdc
commit 7c9c3413cb
No known key found for this signature in database
GPG Key ID: 272ED814BF63261F
2 changed files with 12 additions and 3 deletions

View File

@ -41,7 +41,8 @@ func (post Post) Title() string {
func (post Post) Description() string {
return fmt.Sprintf(
"%s in %s on %s",
"[%s] %s in %s on %s",
post.ID,
post.Author.Name,
post.Forum.Name,
post.CreatedAt.Format("Jan 2 2006"),

View File

@ -83,8 +83,9 @@ func (sys *System) Load() error {
func (sys *System) ListPosts(sysIdx int) ([]post.Post, error) {
resp, err := sys.client.Posts(context.Background(), types.GetPosts{
Type: types.NewOptional(types.ListingLocal),
Sort: types.NewOptional(types.New),
Type: types.NewOptional(types.ListingSubscribed),
Sort: types.NewOptional(types.New),
Limit: types.NewOptional(int64(50)),
})
if err != nil {
return []post.Post{}, err
@ -144,8 +145,15 @@ func (sys *System) LoadPost(p *post.Post) error {
if err != nil {
return err
}
// cid, err := strconv.Atoi(p.Forum.ID)
// if err != nil {
// return err
// }
resp, err := sys.client.Comments(context.Background(), types.GetComments{
Type: types.NewOptional(types.ListingLocal),
Sort: types.NewOptional(types.CommentSortHot),
// CommunityID: types.NewOptional(cid),
PostID: types.NewOptional(pid),
})
if err != nil {