Skip to content

Commit

Permalink
Add voices metadata to rss feed
Browse files Browse the repository at this point in the history
  • Loading branch information
fliiiix committed Dec 27, 2023
1 parent 5fd7aaf commit ef0a26a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions serious/lib/serious/article.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ def audioformats
@audio ||= yaml["audioformats"] || {}
end

def voices
@voices ||= yaml["voices"] || {}
end

# Hash for each file format the matching file size
def audio_file_sizes
return @audio_file_sizes if defined?(@audio_file_sizes)
Expand Down
6 changes: 5 additions & 1 deletion serious/lib/site/views/rss.builder
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require 'cgi'
require 'time'

xml.instruct! :xml, :version=>"1.0", :encoding=>"UTF-8"
xml.rss "xmlns:itunes" => "http://www.itunes.com/dtds/podcast-1.0.dtd", "xmlns:atom" => "http://www.w3.org/2005/Atom", "xmlns:content" => "http://purl.org/rss/1.0/modules/content/", "xmlns:media" => "http://search.yahoo.com/mrss/", :version => "2.0" do
xml.rss "xmlns:itunes" => "http://www.itunes.com/dtds/podcast-1.0.dtd", "xmlns:atom" => "http://www.w3.org/2005/Atom", "xmlns:content" => "http://purl.org/rss/1.0/modules/content/", "xmlns:media" => "http://search.yahoo.com/mrss/", "xmlns:podcast" => "https://podcastindex.org/namespace/1.0", :version => "2.0" do
xml.channel do
xml.title catetory_tite(@category)
xml.link category_url(@category)
Expand Down Expand Up @@ -60,6 +60,10 @@ xml.rss "xmlns:itunes" => "http://www.itunes.com/dtds/podcast-1.0.dtd", "xmlns:a

xml.itunes :duration, article.duration_timestring

# people
for voice in article.voices.select { |key, value| value } do
xml.tag!("podcast:person", "#{voice[0]}")
end
# chapter marks
xml.tag!("psc:chapters", "xmlns:psc" => "http://podlove.org/simple-chapters", :version => "1.2") do
for item in article.chapter do
Expand Down

0 comments on commit ef0a26a

Please sign in to comment.