commit
be4ea860d4
@ -29,7 +29,6 @@ func BenchmarkRenderThread(b *testing.B) {
|
|||||||
func BenchmarkRenderAnimeList(b *testing.B) {
|
func BenchmarkRenderAnimeList(b *testing.B) {
|
||||||
user, _ := arn.GetUser("4J6qpK1ve")
|
user, _ := arn.GetUser("4J6qpK1ve")
|
||||||
animeList := user.AnimeList()
|
animeList := user.AnimeList()
|
||||||
animeList.PrefetchAnime()
|
|
||||||
|
|
||||||
b.ReportAllocs()
|
b.ReportAllocs()
|
||||||
b.ResetTimer()
|
b.ResetTimer()
|
||||||
|
@ -25,7 +25,6 @@ func Get(ctx *aero.Context) string {
|
|||||||
return ctx.Error(http.StatusNotFound, "Anime list not found", nil)
|
return ctx.Error(http.StatusNotFound, "Anime list not found", nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
animeList.PrefetchAnime()
|
|
||||||
animeList.Sort()
|
animeList.Sort()
|
||||||
|
|
||||||
return ctx.HTML(components.ProfileAnimeLists(animeList.SplitByStatus(), animeList.User(), user, ctx.URI()))
|
return ctx.HTML(components.ProfileAnimeLists(animeList.SplitByStatus(), animeList.User(), user, ctx.URI()))
|
||||||
|
@ -39,7 +39,6 @@ func statusList(ctx *aero.Context, status string) (*arn.AnimeList, string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
watchingList := animeList.FilterStatus(status)
|
watchingList := animeList.FilterStatus(status)
|
||||||
watchingList.PrefetchAnime()
|
|
||||||
watchingList.Sort()
|
watchingList.Sort()
|
||||||
|
|
||||||
return watchingList, ""
|
return watchingList, ""
|
||||||
|
@ -53,7 +53,6 @@ func Get(ctx *aero.Context) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
animeList = animeList.Watching()
|
animeList = animeList.Watching()
|
||||||
animeList.PrefetchAnime()
|
|
||||||
|
|
||||||
for _, item := range animeList.Items {
|
for _, item := range animeList.Items {
|
||||||
futureEpisodes := item.Anime().UpcomingEpisodes()
|
futureEpisodes := item.Anime().UpcomingEpisodes()
|
||||||
|
@ -28,7 +28,6 @@ func Get(ctx *aero.Context) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
watchingList := animeList.Watching()
|
watchingList := animeList.Watching()
|
||||||
watchingList.PrefetchAnime()
|
|
||||||
watchingList.Sort()
|
watchingList.Sort()
|
||||||
|
|
||||||
return utils.AllowEmbed(ctx, ctx.HTML(components.AnimeList(watchingList, animeList.User(), user)))
|
return utils.AllowEmbed(ctx, ctx.HTML(components.AnimeList(watchingList, animeList.User(), user)))
|
||||||
|
@ -32,7 +32,6 @@ func AnimeList(ctx *aero.Context, user *arn.User, status string) string {
|
|||||||
return ctx.Error(http.StatusNotFound, "Anime list not found", nil)
|
return ctx.Error(http.StatusNotFound, "Anime list not found", nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
animeList.PrefetchAnime()
|
|
||||||
animeList.Sort()
|
animeList.Sort()
|
||||||
|
|
||||||
return ctx.HTML(components.Home(animeList.FilterStatus(status), viewUser, user, status))
|
return ctx.HTML(components.Home(animeList.FilterStatus(status), viewUser, user, status))
|
||||||
|
@ -37,7 +37,6 @@ func Profile(ctx *aero.Context, viewUser *arn.User) string {
|
|||||||
user = utils.GetUser(ctx)
|
user = utils.GetUser(ctx)
|
||||||
}, func() {
|
}, func() {
|
||||||
animeList = viewUser.AnimeList()
|
animeList = viewUser.AnimeList()
|
||||||
animeList.PrefetchAnime()
|
|
||||||
|
|
||||||
// Sort by rating
|
// Sort by rating
|
||||||
sort.Slice(animeList.Items, func(i, j int) bool {
|
sort.Slice(animeList.Items, func(i, j int) bool {
|
||||||
|
@ -28,7 +28,6 @@ func GetStatsByUser(ctx *aero.Context) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
animeList, err := arn.GetAnimeList(viewUser.ID)
|
animeList, err := arn.GetAnimeList(viewUser.ID)
|
||||||
animeList.PrefetchAnime()
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return ctx.Error(http.StatusInternalServerError, "Anime list not found", err)
|
return ctx.Error(http.StatusInternalServerError, "Anime list not found", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user