add top albums and top tracks widgets to profile

This commit is contained in:
2026-03-02 22:50:30 -08:00
parent 6e0e53eb64
commit 56475df1a0
7 changed files with 600 additions and 3 deletions

View File

@@ -43,6 +43,26 @@ func slice(a []db.TopArtist, start int, end int) []db.TopArtist {
return a[start:end]
}
func sliceAlbum(a []db.TopAlbum, start int, end int) []db.TopAlbum {
if start >= len(a) {
return []db.TopAlbum{}
}
if end > len(a) {
end = len(a)
}
return a[start:end]
}
func sliceTrack(a []db.TopTrack, start int, end int) []db.TopTrack {
if start >= len(a) {
return []db.TopTrack{}
}
if end > len(a) {
end = len(a)
}
return a[start:end]
}
func gridReorder(artists []db.TopArtist) []db.TopArtist {
if len(artists) < 2 {
return artists