From 7716506bb9c2715002c7981ba0a4191bedcd9408 Mon Sep 17 00:00:00 2001 From: Laptop Date: Sun, 6 Oct 2024 15:49:41 +0300 Subject: [PATCH] display license if track has one (https://codeberg.org/maid-zone/soundcloak/issues/1) --- lib/sc/track.go | 1 + templates/track.templ | 3 +++ 2 files changed, 4 insertions(+) diff --git a/lib/sc/track.go b/lib/sc/track.go index 239e798..1d7b8d4 100644 --- a/lib/sc/track.go +++ b/lib/sc/track.go @@ -29,6 +29,7 @@ type Track struct { Genre string `json:"genre"` Kind string `json:"kind"` // should always be "track"! LastModified string `json:"last_modified"` + License string `json:"license"` Likes int64 `json:"likes_count"` Permalink string `json:"permalink"` Played int64 `json:"playback_count"` diff --git a/templates/track.templ b/templates/track.templ index 370c73e..6069045 100644 --- a/templates/track.templ +++ b/templates/track.templ @@ -79,6 +79,9 @@ templ Track(t sc.Track, stream string) {

{ strconv.FormatInt(t.Played, 10) } plays

Created: { t.CreatedAt }

Last modified: { t.LastModified }

+ if t.License != "" { +

License: { t.License }

+ } if t.TagList != "" {

Tags: { strings.Join(sc.TagListParser(t.TagList), ", ") }

}