From fd921f42df4113d591fce24153a6256cc6aed9a7 Mon Sep 17 00:00:00 2001 From: Dovydas Date: Mon, 27 Nov 2023 10:40:08 +0000 Subject: [PATCH] add support for ISRC --- namespace_podcast.go | 7 +++++++ types.go | 1 + types_test.go | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/namespace_podcast.go b/namespace_podcast.go index 7b8a193..5cf2cf9 100644 --- a/namespace_podcast.go +++ b/namespace_podcast.go @@ -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 diff --git a/types.go b/types.go index 73bb1c8..913045e 100644 --- a/types.go +++ b/types.go @@ -100,6 +100,7 @@ type Item struct { ITunesSeasonNumber *int64 `xml:"itunes:season"` PodcastChapters *PodcastChapters PodcastEpisode *PodcastEpisode + PodcastISRC *PodcastISRC PodcastLocation *PodcastLocation PodcastPersons []PodcastPerson PodcastSeason *PodcastSeason diff --git a/types_test.go b/types_test.go index 035ad60..7e14389 100644 --- a/types_test.go +++ b/types_test.go @@ -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 first episode!", @@ -462,6 +465,7 @@ func TestMarshal(t *testing.T) { true 315.5 + AA6Q72000047 Gitmo Nation Alice Brown Becky Smith