Fixes
This commit is contained in:
parent
a45b259839
commit
ed58f31ba2
@ -58,13 +58,14 @@ func averageScore(user *arn.User, animes []*arn.Anime) float64 {
|
||||
|
||||
for _, anime := range animes {
|
||||
userAnime := animeList.Find(anime.ID)
|
||||
|
||||
if userAnime != nil && !userAnime.Rating.IsNotRated() {
|
||||
scores += userAnime.Rating.Overall
|
||||
count++
|
||||
}
|
||||
}
|
||||
|
||||
if count == 0.0 || scores == 0.0 {
|
||||
if count == 0.0 {
|
||||
return 0
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
component Genre(genre string, animes []*arn.Anime, user *arn.User, userScore float64)
|
||||
h1(title=fmt.Sprint(len(animes)) + " anime")= strings.Title(genre)
|
||||
|
||||
if user != nil
|
||||
h2= fmt.Sprintf("%.1f", userScore)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user