open-pod/lib/openpod_web/controllers/page_controller.ex

27 lines
670 B
Elixir
Raw Permalink Normal View History

2020-06-08 23:37:11 +02:00
defmodule OpenpodWeb.PageController do
use OpenpodWeb, :controller
Application.ensure_all_started(:hackney)
@base_url Application.get_env(:openpod, :base_url)
@podders Application.get_env(:openpod, :podders)
|> Enum.map(fn podcast ->
Openpod.Provider.Archive.Parser.by_identifier(podcast)
|> Map.get(:podcast)
|> Map.put(:podcast_url, "#{@base_url}/podcast/#{podcast}")
end)
2020-06-08 23:37:11 +02:00
def index(conn, _params) do
render(conn, "index.html")
end
def howto(conn, _params) do
render(conn, "howto.html")
end
2020-09-09 23:35:31 +02:00
def chi(conn, _params) do
render(conn, "chi.html", podders: @podders)
2020-09-09 23:35:31 +02:00
end
2020-06-08 23:37:11 +02:00
end