From e374779c19521e12a0c328eb2af152a4657ede55 Mon Sep 17 00:00:00 2001 From: danilo silva Date: Sun, 7 Jun 2020 21:09:53 +0000 Subject: [PATCH] removed hardcoding url --- lib/podcast_feed_web/controllers/feed_controller.ex | 8 ++++---- lib/podcast_feed_web/templates/feed/feed.xml.eex | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) 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 %>]]> ]]>