Skip to content

Commit

Permalink
add support for ISRC
Browse files Browse the repository at this point in the history
  • Loading branch information
joksas committed Nov 27, 2023
1 parent f2c978a commit fd921f4
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 @@ -276,6 +276,13 @@ type PodcastTXT struct {
Purpose *string `xml:"purpose,attr"`
}

// PodcastISRC is an experimental tag to store International Standard Recording
// Codes. Read more at https://isrc.ifpi.org
type PodcastISRC struct {
XMLName xml.Name `xml:"podcast:isrc"`
ISRC string `xml:",chardata"`
}

// PodcastPodping allows feed owners to signal to aggregators that the feed sends out Podping notifications when changes are made to it.
// Read more at
// https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md#podping
Expand Down
1 change: 1 addition & 0 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ type Item struct {
ITunesSeasonNumber *int64 `xml:"itunes:season"`
PodcastChapters *PodcastChapters
PodcastEpisode *PodcastEpisode
PodcastISRC *PodcastISRC
PodcastLocation *PodcastLocation
PodcastPersons []PodcastPerson
PodcastSeason *PodcastSeason
Expand Down
4 changes: 4 additions & 0 deletions types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,9 @@ func TestMarshal(t *testing.T) {
GUID: &types.GUID{
GUID: "https://rssblue.com/@bookworm-podcast/hello-world",
},
PodcastISRC: &types.PodcastISRC{
ISRC: "AA6Q72000047",
},
PubDate: pointer(types.Date(time.Date(2021, time.July, 8, 15, 20, 10, 0, time.UTC))),
Description: &types.Description{
Description: "This is my <em>first</em> episode!",
Expand Down Expand Up @@ -462,6 +465,7 @@ func TestMarshal(t *testing.T) {
<itunes:explicit>true</itunes:explicit>
<podcast:chapters url="https://rssblue.com/@bookworm-podcast/hello-world/chapters.json" type="application/json+chapters"></podcast:chapters>
<podcast:episode display="Ch.3">315.5</podcast:episode>
<podcast:isrc>AA6Q72000047</podcast:isrc>
<podcast:location geo="geo:39.7837304,-100.445882;u=3900000" osm="R148838">Gitmo Nation</podcast:location>
<podcast:person group="writing" role="guest" href="https://www.wikipedia/alicebrown" img="http://example.com/images/alicebrown.jpg">Alice Brown</podcast:person>
<podcast:person group="visuals" role="Cover Art Designer" href="https://example.com/artist/beckysmith">Becky Smith</podcast:person>
Expand Down

0 comments on commit fd921f4

Please sign in to comment.