diff --git a/models/post/post.go b/models/post/post.go index 09a3554..ffa07a0 100644 --- a/models/post/post.go +++ b/models/post/post.go @@ -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"), diff --git a/system/lemmy/lemmy.go b/system/lemmy/lemmy.go index 7c9d342..32e79d4 100644 --- a/system/lemmy/lemmy.go +++ b/system/lemmy/lemmy.go @@ -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 {