Refactor search and stringutils into separate modules

This commit is contained in:
2018-04-19 22:01:28 +02:00
parent 99ad9610d3
commit 617e36bc52
12 changed files with 27 additions and 23 deletions

View File

@ -1,6 +1,8 @@
package statistics
import (
"fmt"
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/components"
@ -47,7 +49,7 @@ func getAnimeStats() []*arn.PieChart {
anidb["Not connected with AniDB"]++
}
rating[arn.ToString(int(anime.Rating.Overall+0.5))]++
rating[fmt.Sprint(int(anime.Rating.Overall+0.5))]++
found := false
for _, episode := range anime.Episodes().Items {

View File

@ -42,7 +42,7 @@ func getUserStats() []*arn.PieChart {
pixelRatio[fmt.Sprintf("%.0f", info.Screen.PixelRatio)]++
size := arn.ToString(info.Screen.Width) + " x " + arn.ToString(info.Screen.Height)
size := fmt.Sprint(info.Screen.Width) + " x " + fmt.Sprint(info.Screen.Height)
screenSize[size]++
if info.Connection.EffectiveType != "" {