| Module | Syndication::Podcast::Item |
| In: |
lib/syndication/podcast.rb
|
iTunes fields which occur in Items only.
| itunes_author | [RW] | Artist column in iTunes. |
| itunes_duration | [R] | Duration of item, in seconds. |
Set the duration. Apple specifies four possible formats for the XML data: HH:MM:SS, H:MM:SS, MM:SS, or M:SS.
# File lib/syndication/podcast.rb, line 33 def itunes_duration=(x) if x.match(/(\d?\d):(\d\d):(\d\d)/) @itunes_duration = $3.to_i + $2.to_i * 60 + $1.to_i * 3600 elsif x.match(/(\d?\d):(\d\d)/) @itunes_duration = $2.to_i + $1.to_i * 60 end end