Add podcast email field for RSS itunes:owner tag
Build and Deploy / build-and-deploy (push) Successful in 56s
Build and Deploy / build-and-deploy (push) Successful in 56s
Enables users to set a podcast contact email from the dashboard settings. This email is included in the RSS feed as itunes:owner/itunes:email, which podcast directories like Spotify and Apple Podcasts require for indexing and verification.
This commit is contained in:
@@ -26,11 +26,18 @@ type rssChannel struct {
|
||||
Description string `xml:"description"`
|
||||
Language string `xml:"language"`
|
||||
Author string `xml:"itunes:author,omitempty"`
|
||||
ItunesOwner *rssItunesOwner `xml:"itunes:owner,omitempty"`
|
||||
Image *rssImage `xml:"image,omitempty"`
|
||||
ItunesImage *rssItunesImage `xml:"itunes:image,omitempty"`
|
||||
ItunesType string `xml:"itunes:type,omitempty"`
|
||||
Items []rssItem `xml:"item"`
|
||||
}
|
||||
|
||||
type rssItunesOwner struct {
|
||||
Name string `xml:"itunes:name"`
|
||||
Email string `xml:"itunes:email"`
|
||||
}
|
||||
|
||||
type rssImage struct {
|
||||
URL string `xml:"url"`
|
||||
Title string `xml:"title"`
|
||||
@@ -132,6 +139,14 @@ func (h *RSSHandler) ServeRSS(w http.ResponseWriter, r *http.Request) {
|
||||
chanItunesImage = &rssItunesImage{Href: h.fullURL(user.PodcastImage)}
|
||||
}
|
||||
|
||||
var owner *rssItunesOwner
|
||||
if user.PodcastEmail != "" || author != "" {
|
||||
owner = &rssItunesOwner{
|
||||
Name: author,
|
||||
Email: user.PodcastEmail,
|
||||
}
|
||||
}
|
||||
|
||||
feed := rssFeed{
|
||||
Version: "2.0",
|
||||
ItunesNS: "http://www.itunes.com/dtds/podcast-1.0.dtd",
|
||||
@@ -141,6 +156,7 @@ func (h *RSSHandler) ServeRSS(w http.ResponseWriter, r *http.Request) {
|
||||
Description: title,
|
||||
Language: "en-us",
|
||||
Author: author,
|
||||
ItunesOwner: owner,
|
||||
Image: chanImage,
|
||||
ItunesImage: chanItunesImage,
|
||||
Items: items,
|
||||
|
||||
Reference in New Issue
Block a user