Skip to content

Commit

Permalink
Atom -> RSS
Browse files Browse the repository at this point in the history
  • Loading branch information
sirmarcel committed Nov 19, 2013
1 parent 0d8de58 commit d0292a0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions controllers/feed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

class Podding < Sinatra::Base
get "/feed/:show_name/:audio_format/feed.xml" do |show_name, audio_format|
@episodes = Episode.find_match(show: show_name)
@episodes = []
Episode.all.each do |episode|
@episodes << episode if episode.audioformats.include?(audio_format) and episode.show == show_name
end
@show = Show.first(name: show_name)
@audio_format = audio_format
builder :atom
builder :rss
end

get "/feed/:audio_format/feed.xml" do |audio_format|
Expand All @@ -15,6 +18,6 @@ class Podding < Sinatra::Base
end
@audioformat = Audioformat.first(name: audio_format)
@episodes.inspect.to_s
builder :atom
builder :rss
end
end
2 changes: 1 addition & 1 deletion source

0 comments on commit d0292a0

Please sign in to comment.