Limit tracks
This commit is contained in:
parent
976c964559
commit
2b471b871d
@ -8,6 +8,8 @@ import (
|
|||||||
"github.com/animenotifier/notify.moe/components"
|
"github.com/animenotifier/notify.moe/components"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const maxTracks = 10
|
||||||
|
|
||||||
// Get renders the music page.
|
// Get renders the music page.
|
||||||
func Get(ctx *aero.Context) string {
|
func Get(ctx *aero.Context) string {
|
||||||
tracks := []*arn.SoundTrack{}
|
tracks := []*arn.SoundTrack{}
|
||||||
@ -42,6 +44,10 @@ func Get(ctx *aero.Context) string {
|
|||||||
CreatedBy: "4J6qpK1ve",
|
CreatedBy: "4J6qpK1ve",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if len(tracks) > maxTracks {
|
||||||
|
tracks = tracks[:maxTracks]
|
||||||
|
}
|
||||||
|
|
||||||
sort.Slice(tracks, func(i, j int) bool {
|
sort.Slice(tracks, func(i, j int) bool {
|
||||||
return tracks[i].Created > tracks[j].Created
|
return tracks[i].Created > tracks[j].Created
|
||||||
})
|
})
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
.sound-track-footer
|
.sound-track-footer
|
||||||
text-align right
|
text-align right
|
||||||
margin-bottom content-padding
|
margin-bottom 1rem
|
||||||
font-size 0.9em
|
font-size 0.9em
|
||||||
|
|
||||||
span
|
span
|
||||||
|
Loading…
Reference in New Issue
Block a user