Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Updates iTunes podcast feed and entry support to latest spec #75

Merged

Conversation

weierophinney
Copy link
Member

@weierophinney weierophinney commented May 23, 2018

Makes the following changes to the Zend\Feed\Reader\Extension\Podcast and Zend\Feed\Writer\Extension\ITunes namespaces (which map to the itunes RSS extension):

  • Deprecates Feed::(get|set|add)Keywords() and `Entry::(get|set|add)Keywords(), as the spec no longer supports it.
  • Adds Feed::isComplete()/Feed::setItunesComplete() (mapping to itunes:complete), for retrieving/setting if a podcast is complete (no more episodes will occur).
  • Adds Feed::getPodcastType()/Feed:setItunesType() (mapping to itunes:type), for retrieving/setting the podcast type (one of "serial" or "episodic", the latter being the default).
  • Adds Entry::getEpisode()/Entry::setItunesEpisode() (mapping to itunes:episode), for retrieving/setting the current episode number.
  • Adds Entry::getEpisodeType()/Entry::setItunesEpisodeType() (mapping to itunes:episodeType), for retrieving/setting the current episode type (one of "full", "trailer", or "bonus").
  • Adds Entry::isClosedCaptioned()/Entry::setItunesIsClosedCaptioned() (mapping to itunes:isClosedCaptioned), for retrieving/setting closed captioning status.
  • Adds Entry::getSeason()/Entry::setItunesSeason() (mapping to itunes:season), for retrieving/setting the season to which an episode belongs.

Fixes #66

weierophinney added a commit to weierophinney/zend-feed that referenced this pull request May 23, 2018
@weierophinney
Copy link
Member Author

@OpenHaus — could you review and confirm that the behavior I've added is correct and what you would expect?

Thanks in advance!

@OpenHaus
Copy link
Contributor

Thank you @weierophinney for your effort! It´s great you have taking the time to work on the ticket.

Without testing it, yet, this won´t be the whole solution as it only deals with the Reader part. The Writer should support the new tags as well to close the ticket.

@weierophinney
Copy link
Member Author

The Writer should support the new tags as well to close the ticket.

Ah - right! Thanks for reviewing, as I'd missed that part! I'll get that done this morning.

@weierophinney weierophinney force-pushed the feature/66-itunes-spec-updates branch from aac235e to c0417d4 Compare May 24, 2018 14:18
@weierophinney
Copy link
Member Author

@OpenHaus Changes to the Writer subcomponent have been made and pushed; please review!

Makes the following changes to the `Zend\Feed\Reader\Extension\Podcast`
namespace (which maps to the `itunes` RSS extension):

- Deprecates `Feed::getKeywords()`, as the spec no longer supports it.
- Adds `Feed::isComplete()` (mapping to `itunes:complete`), for
  determining if a podcast is complete (no more episodes will occur).
- Adds `Feed::getPodcastType()` (mapping to `itunes:type`), for
  determining the podcast type (one of "serial" or "episodic", the
  latter being the default)
- Adds `Entry::getEpisode()` (mapping to `itunes:episode`), for
  determining the current episode number.
- Adds `Entry::getEpisodeType()` (mapping to `itunes:episodeType`), for
  determining the current episode type (one of "full", "trailer", or
  "bonus").
So it needs to be deprecated in both.
Adds the following methods to `Zend\Feed\Writer\Extension\ITunes\Entry`:

- `setItunesEpisode(int $number) : self`
- `setItunesEpisodeType(string $type) : self`

Each raises an exception on invalid data, but otherwise sets the data in
the container.

`Zend\Feed\Writer\Extension\ITunes\Renderer\Entry` was updated to now
render these new types.
…sion

Adds the following methods to `Zend\Feed\Writer\Extension\ITunes\Feed`:

- `setItunesType(string $type) : self`
- `setItunesComplete(boolean $status) : self`

It also updates `Zend\Feed\Writer\Extension\ITunes\Renderer\Feed` to
emit the associated tags if data is found for them.
@weierophinney weierophinney force-pushed the feature/66-itunes-spec-updates branch from c0417d4 to 0654328 Compare May 24, 2018 15:30
…sion

Adds the method `Zend\Feed\Reader\Extension\Podcast\Entry::isClosedCaptioned()`.
The method returns `true` if and only if the `itunes:isClosedCaptioned`
tag is both present and has a value of `Yes`.
Adds the method `Zend\Feed\Reader\Extension\Podcast\Entry::getSeason()`.
The method returns either `null`, or an integer indicating the season to
which the episode belongs.
Adds the method `Zend\Feed\Writer\Extension\ITunes\Entry::setItunesIsClosedCaptioned(bool $status) : self`.
The method raises an exception for non-boolean `$status` values. If the
value is boolean true, it stores it; otherwise it ignores it.

`Zend\Feed\Writer\Extension\ITunes\Renderer\Entry` now renders the
`itunes:isClosedCaptioned` tag if the entry indicates it is, using the
value `Yes` as the contents.
Adds the method `Zend\Feed\Writer\Extension\ITunes\Entry::setItunesSeason(int $number) : self`.
The method raises an exception for non-numeric, non-integer values, but
otherwise stores the value as the season number.

Updates `Zend\Feed\Writer\Extension\ITunes\Renderer\Entry` to render the
`itunes:season` tag if a value is present.
@weierophinney
Copy link
Member Author

I've added awareness of itunes:isClosedCaptioned and itunes:season to both the reader and writer extensions as well, rounding out our support for the spec.

@weierophinney weierophinney merged commit 6b422a7 into zendframework:develop May 24, 2018
weierophinney added a commit that referenced this pull request May 24, 2018
@weierophinney weierophinney deleted the feature/66-itunes-spec-updates branch May 24, 2018 16:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants