package templates
import (
"github.com/maid-zone/soundcloak/lib/sc"
"net/url"
"strings"
"strconv"
)
templ FeaturedTracks(p *sc.Paginated[*sc.Track]) {
Featured Tracks
if len(p.Collection) == 0 {
no more tracks
} else {
for _, track := range p.Collection {
@TrackItem(track, true)
}
if p.Next != "" {
more tracks
}
}
}
templ Discover(p *sc.Paginated[*sc.Selection]) {
Discover Playlists
// also tracks apparently? haven't seen any
Got { strconv.FormatInt(int64(len(p.Collection)), 10) } playlists
if len(p.Collection) != 0 {
for _, selection := range p.Collection {
// skip so we don't just include the title and zero playlists with it
if len(selection.Items.Collection) == 0 {
{{ continue }} // raw go code my beloved
}
{selection.Title}
for _, pl := range selection.Items.Collection {
// We don't need the username
@PlaylistItem(pl, false)
}
}
// I don't think they have pagination for this endpoint, just leaving this here, in case they actually do
// if p.Next != "" {
// more playlists
// }
}
}