change opml endpoint to be more inline with the other routes
This commit is contained in:
parent
4cf7d357c7
commit
1f4104236b
3 changed files with 16 additions and 16 deletions
|
|
@ -44,7 +44,7 @@ defmodule PinchflatWeb.Sources.SourceHTML do
|
||||||
end
|
end
|
||||||
|
|
||||||
def opml_feed_url(conn) do
|
def opml_feed_url(conn) do
|
||||||
url(conn, ~p"/podcasts/opml") <> ".xml"
|
url(conn, ~p"/sources/opml") <> ".xml"
|
||||||
end
|
end
|
||||||
|
|
||||||
def output_path_template_override_placeholders(media_profiles) do
|
def output_path_template_override_placeholders(media_profiles) do
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,20 @@ defmodule PinchflatWeb.Router do
|
||||||
plug :maybe_basic_auth
|
plug :maybe_basic_auth
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Routes in here _may not be_ protected by basic auth. This is necessary for
|
||||||
|
# media streaming to work for RSS podcast feeds.
|
||||||
|
scope "/", PinchflatWeb do
|
||||||
|
pipe_through :feeds
|
||||||
|
# has to match before /sources/:id
|
||||||
|
get "/sources/opml", Podcasts.PodcastController, :opml_feed
|
||||||
|
|
||||||
|
get "/sources/:uuid/feed", Podcasts.PodcastController, :rss_feed
|
||||||
|
get "/sources/:uuid/feed_image", Podcasts.PodcastController, :feed_image
|
||||||
|
get "/media/:uuid/episode_image", Podcasts.PodcastController, :episode_image
|
||||||
|
|
||||||
|
get "/media/:uuid/stream", MediaItems.MediaItemController, :stream
|
||||||
|
end
|
||||||
|
|
||||||
scope "/", PinchflatWeb do
|
scope "/", PinchflatWeb do
|
||||||
pipe_through :browser
|
pipe_through :browser
|
||||||
|
|
||||||
|
|
@ -48,20 +62,6 @@ defmodule PinchflatWeb.Router do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Routes in here _may not be_ protected by basic auth. This is necessary for
|
|
||||||
# media streaming to work for RSS podcast feeds.
|
|
||||||
scope "/", PinchflatWeb do
|
|
||||||
pipe_through :feeds
|
|
||||||
|
|
||||||
get "/podcasts/opml", Podcasts.PodcastController, :opml_feed
|
|
||||||
|
|
||||||
get "/sources/:uuid/feed", Podcasts.PodcastController, :rss_feed
|
|
||||||
get "/sources/:uuid/feed_image", Podcasts.PodcastController, :feed_image
|
|
||||||
get "/media/:uuid/episode_image", Podcasts.PodcastController, :episode_image
|
|
||||||
|
|
||||||
get "/media/:uuid/stream", MediaItems.MediaItemController, :stream
|
|
||||||
end
|
|
||||||
|
|
||||||
# No auth or CSRF protection for the health check endpoint
|
# No auth or CSRF protection for the health check endpoint
|
||||||
scope "/", PinchflatWeb do
|
scope "/", PinchflatWeb do
|
||||||
pipe_through :api
|
pipe_through :api
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ defmodule PinchflatWeb.PodcastControllerTest do
|
||||||
test "renders the XML document", %{conn: conn} do
|
test "renders the XML document", %{conn: conn} do
|
||||||
source = source_fixture()
|
source = source_fixture()
|
||||||
|
|
||||||
conn = get(conn, ~p"/podcasts/opml" <> ".xml")
|
conn = get(conn, ~p"/sources/opml" <> ".xml")
|
||||||
|
|
||||||
assert conn.status == 200
|
assert conn.status == 200
|
||||||
assert {"content-type", "application/opml+xml; charset=utf-8"} in conn.resp_headers
|
assert {"content-type", "application/opml+xml; charset=utf-8"} in conn.resp_headers
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue