eduncan911 / podcast

iTunes and RSS 2.0 Podcast Generator in Golang
MIT License
132 stars 35 forks source link

Set podcast.IOwner when calling podcast.AddAuthor(name, email) #35

Open eduncan911 opened 3 years ago

eduncan911 commented 3 years ago

A recent comment on #7 lead me to research the current iteration of itunes' podcast definition.

I found down deep there are now addition sub-fields embedded within the Owner tag.

This issue is for me to research if there is indeed a new set of required sub-fields overall.

A general "refresh" view of all fields to see what has changed in the last four years.

eduncan911 commented 3 years ago

Cc @jzvi12 @mxpv

eduncan911 commented 3 years ago

It looks like iTunes has updated (and removed the listing of several) tags as of April 2019. With that said, there are numerous ways to set Author, Owner, Name, and Email that continue. None are required, but are suggested.

Reference link: https://help.apple.com/itc/podcasts_connect/#/itcb54353390

Therefore, I have opened PR #36 to handle the updates. While iTunes changed are not breaking, the way I'll use AddAuthor() will be. Therefore, #36 will be part of the 2.x changes since it will be a slight breaking change.

I can see that podcast.AddAuthor(name, email string) does not set podcast.IOwner, which is of type Author. I am not sure why I didn't set that explicitly when calling podcast.AddAuthor(). There must have been a reason; however, I did not note that in the notes nor any unit tests. Again, this is now changing as of PR #36.

With the current version 1.x versions, you can set Author and Owner's name and email by doing the following:

p := podcast.New(...)
p.AddAuthor("name", "email@none.org")
p.IOwner = &Author{
    Name:  name,
    Email: email,
}

The functionality that I changed in #36 is to podcast.AddAuthor(). It is breaking because if someone is already setting them differently, this would override anything set manually for podcast.IOwner when calling AddAuthor(). Considering the README already states that, I cannot push that change to the 1.x releases - it will have to be 2.x.

NOTE: For PR #5, I am already removing all of the Formatted suffixed fields in response to the need to unmarshall results back to proper values.

But for now, anyone wanting to set IOwner can use the code listed above.