2017-11-19 16:02:20 +00:00
|
|
|
package soundtracks
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/aerogo/aero"
|
|
|
|
"github.com/animenotifier/arn"
|
|
|
|
)
|
|
|
|
|
2018-03-13 21:38:26 +00:00
|
|
|
// Best renders the best soundtracks.
|
2017-11-19 16:02:20 +00:00
|
|
|
func Best(ctx *aero.Context) string {
|
2018-03-13 21:38:26 +00:00
|
|
|
// Fetch all eligible tracks
|
2018-03-14 17:07:58 +00:00
|
|
|
tracks := fetchAll()
|
2017-11-19 16:02:20 +00:00
|
|
|
|
2018-03-13 22:06:16 +00:00
|
|
|
// Sort the tracks by number of likes
|
2018-03-14 17:07:58 +00:00
|
|
|
arn.SortSoundTracksPopularFirst(tracks)
|
2017-11-19 16:02:20 +00:00
|
|
|
|
2018-03-14 17:07:58 +00:00
|
|
|
// Render
|
|
|
|
return render(ctx, tracks)
|
2017-11-19 16:02:20 +00:00
|
|
|
}
|