mirror of
https://git.maid.zone/stuff/soundcloak.git
synced 2025-12-11 06:09:38 +05:00
small fix
This commit is contained in:
@@ -467,8 +467,8 @@ func (t Track) Href() string {
|
|||||||
return "/" + t.Author.Permalink + "/" + t.Permalink
|
return "/" + t.Author.Permalink + "/" + t.Permalink
|
||||||
}
|
}
|
||||||
|
|
||||||
func RecentTracks(cid string, prefs cfg.Preferences, tag string, args string) (*Paginated[*Track], error) {
|
func RecentTracks(cid string, prefs cfg.Preferences, args string) (*Paginated[*Track], error) {
|
||||||
p := Paginated[*Track]{Next: "https://" + api + "/recent-tracks/" + tag + args}
|
p := Paginated[*Track]{Next: "https://" + api + "/recent-tracks/" + args}
|
||||||
err := p.Proceed(cid, true)
|
err := p.Proceed(cid, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
2
main.go
2
main.go
@@ -200,7 +200,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tag := c.Params("tag")
|
tag := c.Params("tag")
|
||||||
p, err := sc.RecentTracks(cid, prefs, tag, c.Query("pagination", "?limit=20"))
|
p, err := sc.RecentTracks(cid, prefs, c.Query("pagination", tag+"?limit=20"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("error getting %s tagged recent-tracks: %s\n", tag, err)
|
log.Printf("error getting %s tagged recent-tracks: %s\n", tag, err)
|
||||||
return err
|
return err
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ templ RecentTracks(tag string, p *sc.Paginated[*sc.Track]) {
|
|||||||
@TrackItem(track, true, "")
|
@TrackItem(track, true, "")
|
||||||
}
|
}
|
||||||
if p.Next != "" {
|
if p.Next != "" {
|
||||||
<a class="btn" href={ templ.URL("/tags/" + tag + "?pagination=" + url.QueryEscape(strings.Split(p.Next, "/recent-tracks")[1])) } rel="noreferrer">more tracks</a>
|
<a class="btn" href={ templ.URL("?pagination=" + url.QueryEscape(strings.Split(p.Next, "/recent-tracks")[1])) } rel="noreferrer">more tracks</a>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -48,7 +48,7 @@ templ PopularTracks(tag string, p *sc.Paginated[*sc.Track]) {
|
|||||||
@TrackItem(track, true, "")
|
@TrackItem(track, true, "")
|
||||||
}
|
}
|
||||||
if p.Next != "" {
|
if p.Next != "" {
|
||||||
<a class="btn" href={ templ.URL("/tags/" + tag + "/popular-tracks?pagination=" + url.QueryEscape(strings.Split(p.Next, "/tracks")[1])) } rel="noreferrer">more tracks</a>
|
<a class="btn" href={ templ.URL("?pagination=" + url.QueryEscape(strings.Split(p.Next, "/tracks")[1])) } rel="noreferrer">more tracks</a>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -68,7 +68,7 @@ templ TaggedPlaylists(tag string, p *sc.Paginated[*sc.Playlist]) {
|
|||||||
@PlaylistItem(playlist, true)
|
@PlaylistItem(playlist, true)
|
||||||
}
|
}
|
||||||
if p.Next != "" && len(p.Collection) != int(p.Total) {
|
if p.Next != "" && len(p.Collection) != int(p.Total) {
|
||||||
<a class="btn" href={ templ.URL("?type=playlists&pagination=" + url.QueryEscape(strings.Split(p.Next, "/playlists")[1])) } rel="noreferrer">more playlists</a>
|
<a class="btn" href={ templ.URL("?pagination=" + url.QueryEscape(strings.Split(p.Next, "/playlists")[1])) } rel="noreferrer">more playlists</a>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user