Skip to content

Commit

Permalink
add <podcast:singleItem>
Browse files Browse the repository at this point in the history
  • Loading branch information
joksas committed Jan 26, 2024
1 parent 38a979e commit 2e20766
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions namespace_podcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,3 +379,10 @@ type PodcastChat struct {
Space *string `xml:"space,attr"`
EmbedURL *string `xml:"embedUrl,attr"`
}

// PodcastSingleItem denotes whether the feed contains a single item or multiple items.
// It's a proposal described at https://github.com/Podcastindex-org/podcast-namespace/discussions/578
type PodcastSingleItem struct {
XMLName xml.Name `xml:"podcast:singleItem"`
Value bool `xml:",chardata"`
}
1 change: 1 addition & 0 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ type Channel struct {
PodcastPersons []PodcastPerson
PodcastPodping *PodcastPodping
PodcastRemoteItems []PodcastRemoteItem
PodcastSingleItem *PodcastSingleItem
PodcastTXTs []PodcastTXT
PodcastTrailers []PodcastTrailer
PodcastValue *PodcastValue
Expand Down
4 changes: 4 additions & 0 deletions types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ func TestMarshal(t *testing.T) {
Caption: "Support “Bookworm Podcast”",
},
},
PodcastSingleItem: &types.PodcastSingleItem{
Value: false,
},
PodcastValue: &types.PodcastValue{
Type: "lightning",
Method: "keysend",
Expand Down Expand Up @@ -433,6 +436,7 @@ func TestMarshal(t *testing.T) {
<podcast:medium>podcast</podcast:medium>
<podcast:person href="https://example.com/johnsmith/blog" img="http://example.com/images/johnsmith.jpg">John Smith</podcast:person>
<podcast:podping usesPodping="true"></podcast:podping>
<podcast:singleItem>false</podcast:singleItem>
<podcast:txt>naj3eEZaWVVY9a38uhX8FekACyhtqP4JN</podcast:txt>
<podcast:txt purpose="verify">S6lpp-7ZCn8-dZfGc-OoyaG</podcast:txt>
<podcast:trailer pubdate="Thu, 01 Apr 2021 08:00:00 GMT" url="https://example.org/trailers/teaser" length="12345678" type="audio/mp3">Coming April 1st, 2021</podcast:trailer>
Expand Down

0 comments on commit 2e20766

Please sign in to comment.