Relevant characters sub-sorted by likes now

This commit is contained in:
Eduard Urbach 2018-11-07 17:34:22 +09:00
parent fe33054f31
commit e08f4c2f09

View File

@ -75,7 +75,14 @@ func Get(ctx *aero.Context) string {
bRelevance := characterAppearances[relevantCharacters[j].ID]
if aRelevance == bRelevance {
return relevantCharacters[i].Name.Canonical < relevantCharacters[j].Name.Canonical
aLikes := len(relevantCharacters[i].Likes)
bLikes := len(relevantCharacters[j].Likes)
if aLikes == bLikes {
return relevantCharacters[i].Name.Canonical < relevantCharacters[j].Name.Canonical
}
return aLikes > bLikes
}
return aRelevance > bRelevance