feat(feed): Increase number of activities fetched from the server

This commit is contained in:
Noah 2024-03-19 18:30:08 -05:00
parent d57c150cf3
commit 62982c63d8

15
feed.go
View File

@ -30,7 +30,7 @@ func getActivityFeed() []Activity {
feed := []Activity{} feed := []Activity{}
for _, server := range config.servers { for _, server := range config.servers {
client := Servers[server.servername] client := Servers[server.servername]
resp, err := http.Get(fmt.Sprintf("%s/api/v1/users/%s/activities/feeds?limit=10&page=1", resp, err := http.Get(fmt.Sprintf("%s/api/v1/users/%s/activities/feeds?limit=15&page=1",
server.url, server.url,
server.username, server.username,
)) ))
@ -52,17 +52,6 @@ func getActivityFeed() []Activity {
fmt.Println("Error getting user: "+fmt.Sprint(err)) fmt.Println("Error getting user: "+fmt.Sprint(err))
continue continue
} }
// repo, _, err := client.GetRepo(
// obj["repo"].
// (map[string]interface{})["name"].(string),
// obj["repo"].
// (map[string]interface{})["owner"].
// (map[string]interface{})["login"].(string),
// )
// if err != nil {
// fmt.Println("Failed to get repository: "+fmt.Sprint(err))
// continue
// }
var comment gitea.Comment var comment gitea.Comment
if obj["comment"] != nil { if obj["comment"] != nil {
raw_comment := obj["comment"].(map[string]interface{}) raw_comment := obj["comment"].(map[string]interface{})
@ -94,3 +83,5 @@ func getActivityFeed() []Activity {
} }
return feed return feed
} }