diff --git a/lib/podcast_feed_web/controllers/feed_controller.ex b/lib/podcast_feed_web/controllers/feed_controller.ex index 6fa833c..22ae924 100644 --- a/lib/podcast_feed_web/controllers/feed_controller.ex +++ b/lib/podcast_feed_web/controllers/feed_controller.ex @@ -3,17 +3,17 @@ defmodule PodcastFeedWeb.FeedController do alias PodcastFeed.Boundary.ArchiveServer def by_identifier(conn, %{"identifier" => identifier, "reload" => _}) do - do_by_identifier(conn, fn -> ArchiveServer.reload(identifier) end) + do_by_identifier(conn, identifier, fn -> ArchiveServer.reload(identifier) end) end def by_identifier(conn, %{"identifier" => identifier}) do - do_by_identifier(conn, fn -> ArchiveServer.get_feed(identifier) end) + do_by_identifier(conn, identifier, fn -> ArchiveServer.get_feed(identifier) end) end - defp do_by_identifier(conn, fetcher) do + defp do_by_identifier(conn, identifier, fetcher) do %{podcast: podcast, items: items} = fetcher.() conn |> put_resp_content_type("text/xml") - |> render("feed.xml", podcast: podcast, items: items) + |> render("feed.xml", identifier: identifier, podcast: podcast, items: items) end end diff --git a/lib/podcast_feed_web/templates/feed/feed.xml.eex b/lib/podcast_feed_web/templates/feed/feed.xml.eex index 2ef11eb..50bc7a6 100644 --- a/lib/podcast_feed_web/templates/feed/feed.xml.eex +++ b/lib/podcast_feed_web/templates/feed/feed.xml.eex @@ -21,7 +21,7 @@ <%= @podcast.keywords |> Enum.join(", ") %> ]]> - + <%= @podcast.pubDate |> Calendar.DateTime.Format.rfc2822 %> <![CDATA[<%= @podcast.title %>]]> ]]>