|
|
|
@ -113,73 +113,73 @@ func (p *Podcast) AddAtomLink(href string) {
|
|
|
|
|
// used and will invalidate the feed if deviated from the list. That list is
|
|
|
|
|
// as follows.
|
|
|
|
|
//
|
|
|
|
|
// Arts
|
|
|
|
|
// * Design
|
|
|
|
|
// * Fashion & Beauty
|
|
|
|
|
// * Food
|
|
|
|
|
// * Literature
|
|
|
|
|
// * Performing Arts
|
|
|
|
|
// * Visual Arts
|
|
|
|
|
// Business
|
|
|
|
|
// * Business News
|
|
|
|
|
// * Careers
|
|
|
|
|
// * Investing
|
|
|
|
|
// * Management & Marketing
|
|
|
|
|
// * Shopping
|
|
|
|
|
// Comedy
|
|
|
|
|
// Education
|
|
|
|
|
// * Education Technology
|
|
|
|
|
// * Higher Education
|
|
|
|
|
// * K-12
|
|
|
|
|
// * Language Courses
|
|
|
|
|
// * Training
|
|
|
|
|
// Games & Hobbies
|
|
|
|
|
// * Automotive
|
|
|
|
|
// * Aviation
|
|
|
|
|
// * Hobbies
|
|
|
|
|
// * Other Games
|
|
|
|
|
// * Video Games
|
|
|
|
|
// Government & Organizations
|
|
|
|
|
// * Local
|
|
|
|
|
// * National
|
|
|
|
|
// * Non-Profit
|
|
|
|
|
// * Regional
|
|
|
|
|
// Health
|
|
|
|
|
// * Alternative Health
|
|
|
|
|
// * Fitness & Nutrition
|
|
|
|
|
// * Self-Help
|
|
|
|
|
// * Sexuality
|
|
|
|
|
// Kids & Family
|
|
|
|
|
// Music
|
|
|
|
|
// News & Politics
|
|
|
|
|
// Religion & Spirituality
|
|
|
|
|
// * Buddhism
|
|
|
|
|
// * Christianity
|
|
|
|
|
// * Hinduism
|
|
|
|
|
// * Islam
|
|
|
|
|
// * Judaism
|
|
|
|
|
// * Other
|
|
|
|
|
// * Spirituality
|
|
|
|
|
// Science & Medicine
|
|
|
|
|
// * Medicine
|
|
|
|
|
// * Natural Sciences
|
|
|
|
|
// * Social Sciences
|
|
|
|
|
// Society & Culture
|
|
|
|
|
// * History
|
|
|
|
|
// * Personal Journals
|
|
|
|
|
// * Philosophy
|
|
|
|
|
// * Places & Travel
|
|
|
|
|
// Sports & Recreation
|
|
|
|
|
// * Amateur
|
|
|
|
|
// * College & High School
|
|
|
|
|
// * Outdoor
|
|
|
|
|
// * Professional
|
|
|
|
|
// Technology
|
|
|
|
|
// * Gadgets
|
|
|
|
|
// * Podcasting
|
|
|
|
|
// * Software How-To
|
|
|
|
|
// * Tech News
|
|
|
|
|
// TV & Film
|
|
|
|
|
// * Arts
|
|
|
|
|
// * Design
|
|
|
|
|
// * Fashion & Beauty
|
|
|
|
|
// * Food
|
|
|
|
|
// * Literature
|
|
|
|
|
// * Performing Arts
|
|
|
|
|
// * Visual Arts
|
|
|
|
|
// * Business
|
|
|
|
|
// * Business News
|
|
|
|
|
// * Careers
|
|
|
|
|
// * Investing
|
|
|
|
|
// * Management & Marketing
|
|
|
|
|
// * Shopping
|
|
|
|
|
// * Comedy
|
|
|
|
|
// * Education
|
|
|
|
|
// * Education Technology
|
|
|
|
|
// * Higher Education
|
|
|
|
|
// * K-12
|
|
|
|
|
// * Language Courses
|
|
|
|
|
// * Training
|
|
|
|
|
// * Games & Hobbies
|
|
|
|
|
// * Automotive
|
|
|
|
|
// * Aviation
|
|
|
|
|
// * Hobbies
|
|
|
|
|
// * Other Games
|
|
|
|
|
// * Video Games
|
|
|
|
|
// * Government & Organizations
|
|
|
|
|
// * Local
|
|
|
|
|
// * National
|
|
|
|
|
// * Non-Profit
|
|
|
|
|
// * Regional
|
|
|
|
|
// * Health
|
|
|
|
|
// * Alternative Health
|
|
|
|
|
// * Fitness & Nutrition
|
|
|
|
|
// * Self-Help
|
|
|
|
|
// * Sexuality
|
|
|
|
|
// * Kids & Family
|
|
|
|
|
// * Music
|
|
|
|
|
// * News & Politics
|
|
|
|
|
// * Religion & Spirituality
|
|
|
|
|
// * Buddhism
|
|
|
|
|
// * Christianity
|
|
|
|
|
// * Hinduism
|
|
|
|
|
// * Islam
|
|
|
|
|
// * Judaism
|
|
|
|
|
// * Other
|
|
|
|
|
// * Spirituality
|
|
|
|
|
// * Science & Medicine
|
|
|
|
|
// * Medicine
|
|
|
|
|
// * Natural Sciences
|
|
|
|
|
// * Social Sciences
|
|
|
|
|
// * Society & Culture
|
|
|
|
|
// * History
|
|
|
|
|
// * Personal Journals
|
|
|
|
|
// * Philosophy
|
|
|
|
|
// * Places & Travel
|
|
|
|
|
// * Sports & Recreation
|
|
|
|
|
// * Amateur
|
|
|
|
|
// * College & High School
|
|
|
|
|
// * Outdoor
|
|
|
|
|
// * Professional
|
|
|
|
|
// * Technology
|
|
|
|
|
// * Gadgets
|
|
|
|
|
// * Podcasting
|
|
|
|
|
// * Software How-To
|
|
|
|
|
// * Tech News
|
|
|
|
|
// * TV & Film
|
|
|
|
|
func (p *Podcast) AddCategory(category string, subCategories []string) {
|
|
|
|
|
if len(category) == 0 {
|
|
|
|
|
return
|
|
|
|
@ -229,7 +229,7 @@ func (p *Podcast) AddImage(url string) {
|
|
|
|
|
// This method takes the "itunes overrides" approach to populating
|
|
|
|
|
// itunes tags according to the overrides rules in the specification.
|
|
|
|
|
// This not only complies completely with iTunes parsing rules; but, it also
|
|
|
|
|
// displays what is possible to be set on an individual episode level - if you
|
|
|
|
|
// displays what is possible to be set on an individual episode level – if you
|
|
|
|
|
// wish to have more fine grain control over your content.
|
|
|
|
|
//
|
|
|
|
|
// This method imposes strict validation of the Item being added to confirm
|
|
|
|
@ -237,32 +237,32 @@ func (p *Podcast) AddImage(url string) {
|
|
|
|
|
//
|
|
|
|
|
// Article minimal requirements are:
|
|
|
|
|
//
|
|
|
|
|
// * Title
|
|
|
|
|
// * Description
|
|
|
|
|
// * Link
|
|
|
|
|
// * Title
|
|
|
|
|
// * Description
|
|
|
|
|
// * Link
|
|
|
|
|
//
|
|
|
|
|
// Audio, Video and Downloads minimal requirements are:
|
|
|
|
|
//
|
|
|
|
|
// * Title
|
|
|
|
|
// * Description
|
|
|
|
|
// * Enclosure (HREF, Type and Length all required)
|
|
|
|
|
// * Title
|
|
|
|
|
// * Description
|
|
|
|
|
// * Enclosure (HREF, Type and Length all required)
|
|
|
|
|
//
|
|
|
|
|
// The following fields are always overwritten (don't set them):
|
|
|
|
|
//
|
|
|
|
|
// * GUID
|
|
|
|
|
// * PubDateFormatted
|
|
|
|
|
// * AuthorFormatted
|
|
|
|
|
// * Enclosure.TypeFormatted
|
|
|
|
|
// * Enclosure.LengthFormatted
|
|
|
|
|
// * GUID
|
|
|
|
|
// * PubDateFormatted
|
|
|
|
|
// * AuthorFormatted
|
|
|
|
|
// * Enclosure.TypeFormatted
|
|
|
|
|
// * Enclosure.LengthFormatted
|
|
|
|
|
//
|
|
|
|
|
// Recommendations:
|
|
|
|
|
//
|
|
|
|
|
// * Just set the minimal fields: the rest get set for you.
|
|
|
|
|
// * Always set an Enclosure.Length, to be nice to your downloaders.
|
|
|
|
|
// * Follow Apple's best practices to enrich your podcasts:
|
|
|
|
|
// https://help.apple.com/itc/podcasts_connect/#/itc2b3780e76
|
|
|
|
|
// * For specifications of itunes tags, see:
|
|
|
|
|
// https://help.apple.com/itc/podcasts_connect/#/itcb54353390
|
|
|
|
|
// * Just set the minimal fields: the rest get set for you.
|
|
|
|
|
// * Always set an Enclosure.Length, to be nice to your downloaders.
|
|
|
|
|
// * Follow Apple's best practices to enrich your podcasts:
|
|
|
|
|
// https://help.apple.com/itc/podcasts_connect/#/itc2b3780e76
|
|
|
|
|
// * For specifications of itunes tags, see:
|
|
|
|
|
// https://help.apple.com/itc/podcasts_connect/#/itcb54353390
|
|
|
|
|
//
|
|
|
|
|
func (p *Podcast) AddItem(i Item) (int, error) {
|
|
|
|
|
// initial guards for required fields
|
|
|
|
@ -364,7 +364,7 @@ func (p *Podcast) AddSubTitle(subTitle string) {
|
|
|
|
|
// Limit: 4000 characters
|
|
|
|
|
//
|
|
|
|
|
// Note that this field is a CDATA encoded field which allows for rich text
|
|
|
|
|
// such as html links: <a href="http://www.apple.com">Apple</a>.
|
|
|
|
|
// such as html links: `<a href="http://www.apple.com">Apple</a>`.
|
|
|
|
|
func (p *Podcast) AddSummary(summary string) {
|
|
|
|
|
count := utf8.RuneCountInString(summary)
|
|
|
|
|
if count == 0 {
|
|
|
|
|