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