Sort by followers and make it deterministic

This commit is contained in:
Eduard Urbach 2017-11-17 15:16:47 +01:00
parent aea25d367d
commit 534286132d

View File

@ -15,7 +15,14 @@ func Active(ctx *aero.Context) string {
})
sort.Slice(users, func(i, j int) bool {
return len(users[i].AnimeList().Watching().Items) > len(users[j].AnimeList().Watching().Items)
followersA := users[i].FollowersCount()
followersB := users[j].FollowersCount()
if followersA == followersB {
return users[i].Nick > users[j].Nick
}
return followersA > followersB
})
// arn.SortUsersLastSeen(users)