mirror of
https://github.com/fiatjaf/nak.git
synced 2026-07-28 23:37:45 +02:00
Merge pull request #181 from mattn/fix/podcast-author-no-role
podcast: don't drop authors whose p tag has no role element
This commit is contained in:
12
podcast.go
12
podcast.go
@@ -556,16 +556,16 @@ func printPodcastInfo(p podcastInfo) {
|
||||
|
||||
authors := make([]string, 0, 2)
|
||||
for _, tag := range p.Metadata.Tags {
|
||||
if len(tag) >= 3 && tag[0] == "p" {
|
||||
role := ""
|
||||
if len(tag) >= 3 {
|
||||
role = tag[2]
|
||||
}
|
||||
if len(tag) >= 2 && tag[0] == "p" {
|
||||
pk, err := nostr.PubKeyFromHex(tag[1])
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
authors = append(authors, nip19.EncodeNpub(pk)+" "+role)
|
||||
author := nip19.EncodeNpub(pk)
|
||||
if len(tag) >= 3 && tag[2] != "" {
|
||||
author += " " + tag[2]
|
||||
}
|
||||
authors = append(authors, author)
|
||||
}
|
||||
}
|
||||
if len(authors) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user