podcast: don't drop authors whose p tag has no role element.

This commit is contained in:
Yasuhiro Matsumoto
2026-07-15 18:12:13 +09:00
parent f10555037e
commit 2298e37cdf
+6 -6
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 {