Improved exploration
This commit is contained in:
@ -1,21 +0,0 @@
|
||||
package airing
|
||||
|
||||
import (
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/arn"
|
||||
"github.com/animenotifier/notify.moe/components"
|
||||
)
|
||||
|
||||
// Get ...
|
||||
func Get(ctx *aero.Context) string {
|
||||
var cache arn.ListOfIDs
|
||||
err := arn.DB.GetObject("Cache", "airing anime", &cache)
|
||||
|
||||
airing, err := arn.GetAiringAnimeCached()
|
||||
|
||||
if err != nil {
|
||||
return ctx.Error(500, "Couldn't fetch airing anime", err)
|
||||
}
|
||||
|
||||
return ctx.HTML(components.Airing(airing))
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
component Airing(animeList []*arn.Anime)
|
||||
h2.page-title(title=toString(len(animeList)) + " anime") Airing
|
||||
AnimeGrid(animeList)
|
@ -38,7 +38,10 @@ component Anime(anime *arn.Anime, tracks []*arn.SoundTrack, user *arn.User, epis
|
||||
h3.anime-section-name Ratings
|
||||
.anime-rating-categories
|
||||
.anime-rating-category(title=toString(anime.Rating.Overall))
|
||||
.anime-rating-category-name Overall
|
||||
if anime.Status == "upcoming"
|
||||
.anime-rating-category-name Hype
|
||||
else
|
||||
.anime-rating-category-name Overall
|
||||
Rating(anime.Rating.Overall)
|
||||
.anime-rating-category(title=toString(anime.Rating.Story))
|
||||
.anime-rating-category-name Story
|
||||
|
@ -14,7 +14,7 @@ component AnimeListItem(viewUser *arn.User, item *arn.AnimeListItem, anime *arn.
|
||||
option(value=arn.AnimeListStatusDropped) Dropped
|
||||
|
||||
.anime-list-item-rating-edit
|
||||
InputNumber("Rating.Overall", item.Rating.Overall, item.OverallRatingName(), "Overall rating on a scale of 0 to 10", "0", "10", "0.1")
|
||||
InputNumber("Rating.Overall", item.Rating.Overall, arn.OverallRatingName(item.Episodes), "Overall rating on a scale of 0 to 10", "0", "10", "0.1")
|
||||
InputNumber("Rating.Story", item.Rating.Story, "Story", "Story rating on a scale of 0 to 10", "0", "10", "0.1")
|
||||
InputNumber("Rating.Visuals", item.Rating.Visuals, "Visuals", "Visuals rating on a scale of 0 to 10", "0", "10", "0.1")
|
||||
InputNumber("Rating.Soundtrack", item.Rating.Soundtrack, "Soundtrack", "Soundtrack rating on a scale of 0 to 10", "0", "10", "0.1")
|
||||
|
46
pages/best/best.go
Normal file
46
pages/best/best.go
Normal file
@ -0,0 +1,46 @@
|
||||
package best
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/arn"
|
||||
"github.com/animenotifier/notify.moe/components"
|
||||
)
|
||||
|
||||
const maxEntries = 7
|
||||
|
||||
// Get search page.
|
||||
func Get(ctx *aero.Context) string {
|
||||
overall, err := arn.GetListOfAnimeCached("best anime overall")
|
||||
|
||||
if err != nil {
|
||||
return ctx.Error(http.StatusInternalServerError, "Error fetching popular anime", err)
|
||||
}
|
||||
|
||||
story, err := arn.GetListOfAnimeCached("best anime story")
|
||||
|
||||
if err != nil {
|
||||
return ctx.Error(http.StatusInternalServerError, "Error fetching popular anime", err)
|
||||
}
|
||||
|
||||
visuals, err := arn.GetListOfAnimeCached("best anime visuals")
|
||||
|
||||
if err != nil {
|
||||
return ctx.Error(http.StatusInternalServerError, "Error fetching popular anime", err)
|
||||
}
|
||||
|
||||
soundtrack, err := arn.GetListOfAnimeCached("best anime soundtrack")
|
||||
|
||||
if err != nil {
|
||||
return ctx.Error(http.StatusInternalServerError, "Error fetching popular anime", err)
|
||||
}
|
||||
|
||||
airing, err := arn.GetAiringAnimeCached()
|
||||
|
||||
if err != nil {
|
||||
return ctx.Error(500, "Couldn't fetch airing anime", err)
|
||||
}
|
||||
|
||||
return ctx.HTML(components.BestAnime(overall[:maxEntries], story[:maxEntries], visuals[:maxEntries], soundtrack[:maxEntries], airing[:maxEntries]))
|
||||
}
|
15
pages/best/best.pixy
Normal file
15
pages/best/best.pixy
Normal file
@ -0,0 +1,15 @@
|
||||
component BestAnime(overall []*arn.Anime, story []*arn.Anime, visuals []*arn.Anime, soundtrack []*arn.Anime, airing []*arn.Anime)
|
||||
h2 Currently Airing
|
||||
AnimeGrid(airing)
|
||||
|
||||
h2 Best Overall
|
||||
AnimeGrid(overall)
|
||||
|
||||
h2 Best Story
|
||||
AnimeGrid(story)
|
||||
|
||||
h2 Best Visuals
|
||||
AnimeGrid(visuals)
|
||||
|
||||
h2 Best Soundtrack
|
||||
AnimeGrid(soundtrack)
|
@ -1,20 +1,21 @@
|
||||
package explore
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/arn"
|
||||
"github.com/animenotifier/notify.moe/components"
|
||||
)
|
||||
|
||||
// Get search page.
|
||||
// Get ...
|
||||
func Get(ctx *aero.Context) string {
|
||||
animeList, err := arn.GetPopularAnimeCached()
|
||||
var cache arn.ListOfIDs
|
||||
err := arn.DB.GetObject("Cache", "airing anime", &cache)
|
||||
|
||||
airing, err := arn.GetAiringAnimeCached()
|
||||
|
||||
if err != nil {
|
||||
return ctx.Error(http.StatusInternalServerError, "Error fetching popular anime", err)
|
||||
return ctx.Error(500, "Couldn't fetch airing anime", err)
|
||||
}
|
||||
|
||||
return ctx.HTML(components.ExploreAnime(nil, nil, animeList))
|
||||
return ctx.HTML(components.Airing(airing))
|
||||
}
|
||||
|
@ -1,9 +1,3 @@
|
||||
component ExploreAnime(overall []*arn.Anime, story []*arn.Anime, airing []*arn.Anime)
|
||||
h2 Highest Rating
|
||||
AnimeGrid(overall)
|
||||
|
||||
h2 Best Story
|
||||
AnimeGrid(story)
|
||||
|
||||
h2 Currently Airing
|
||||
AnimeGrid(airing)
|
||||
component Airing(animeList []*arn.Anime)
|
||||
h2.page-title(title=toString(len(animeList)) + " anime") Explore
|
||||
AnimeGrid(animeList)
|
Reference in New Issue
Block a user