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:
mattn
2026-07-15 09:21:08 +00:00
committed by GitHub

View File

@@ -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 {