Migration to nano

This commit is contained in:
2017-11-01 09:45:14 +01:00
parent 32d7378e87
commit c60f53ed76
7 changed files with 228 additions and 212 deletions

View File

@ -11,7 +11,7 @@ import (
"github.com/animenotifier/notify.moe/utils"
)
const maxPosts = 5
const maxForumActivity = 5
const maxFollowing = 5
const maxSoundTracks = 5
const maxScheduleItems = 5
@ -30,7 +30,21 @@ func Get(ctx *aero.Context) string {
}
flow.Parallel(func() {
forumActivity, _ = arn.GetForumActivityCached()
posts := arn.AllPosts()
threads := arn.AllThreads()
arn.SortPostsLatestFirst(posts)
arn.SortThreadsLatestFirst(threads)
posts = arn.FilterPostsWithUniqueThreads(posts, maxForumActivity)
postPostables := arn.ToPostables(posts)
threadPostables := arn.ToPostables(threads)
allPostables := append(postPostables, threadPostables...)
arn.SortPostablesLatestFirst(allPostables)
forumActivity = arn.FilterPostablesWithUniqueThreads(allPostables, maxForumActivity)
}, func() {
animeList, err := arn.GetAnimeList(user.ID)