Small refactorings
This commit is contained in:
parent
8891ea4369
commit
320649b81d
@ -84,12 +84,10 @@ func totalCompleted(user *arn.User, animes []*arn.Anime) int {
|
|||||||
completedList := user.AnimeList().FilterStatus(arn.AnimeListStatusCompleted)
|
completedList := user.AnimeList().FilterStatus(arn.AnimeListStatusCompleted)
|
||||||
|
|
||||||
for _, anime := range animes {
|
for _, anime := range animes {
|
||||||
userAnime := completedList.Find(anime.ID)
|
if completedList.Contains(anime.ID) {
|
||||||
|
count++
|
||||||
if userAnime != nil {
|
|
||||||
count++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return count;
|
return count
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
component Genre(genre string, animes []*arn.Anime, user *arn.User, userScore float64, userCompleted int)
|
component Genre(genre string, animes []*arn.Anime, user *arn.User, userScore float64, userCompleted int)
|
||||||
h1(title=fmt.Sprint(len(animes)) + " anime")= strings.Title(genre)
|
h1(title=fmt.Sprint(len(animes)) + " anime")= strings.Title(genre)
|
||||||
|
|
||||||
if user != nil
|
GenreStatistics(user, userScore, userCompleted)
|
||||||
.average-score-total-completed
|
|
||||||
p= fmt.Sprintf("Average rating: %." + strconv.Itoa(user.Settings().Format.RatingsPrecision) + "f | Total completed: %d", userScore, userCompleted)
|
|
||||||
|
|
||||||
.corner-buttons-hide-on-mobile
|
.corner-buttons-hide-on-mobile
|
||||||
if user != nil
|
if user != nil
|
||||||
@ -14,3 +12,8 @@ component Genre(genre string, animes []*arn.Anime, user *arn.User, userScore flo
|
|||||||
RawIcon("clone")
|
RawIcon("clone")
|
||||||
|
|
||||||
AnimeGrid(animes, user)
|
AnimeGrid(animes, user)
|
||||||
|
|
||||||
|
component GenreStatistics(user *arn.User, userScore float64, userCompleted int)
|
||||||
|
if user != nil
|
||||||
|
.average-score-total-completed
|
||||||
|
p= fmt.Sprintf("Average rating: %." + strconv.Itoa(user.Settings().Format.RatingsPrecision) + "f | Total completed: %d", userScore, userCompleted)
|
Loading…
Reference in New Issue
Block a user