Browse Source

using json instaed of xml

removed hardcoded from generic podcast medatadata
danilo silva 4 years ago
parent
commit
6b042f65ab

+ 6 - 6
config/test.exs

@@ -5,12 +5,12 @@ use Mix.Config
 # The MIX_TEST_PARTITION environment variable can be used
 # to provide built-in test partitioning in CI environment.
 # Run `mix help test` for more information.
-config :podcast_feed, PodcastFeed.Repo,
-  username: "postgres",
-  password: "postgres",
-  database: "podcast_feed_test#{System.get_env("MIX_TEST_PARTITION")}",
-  hostname: "localhost",
-  pool: Ecto.Adapters.SQL.Sandbox
+# config :podcast_feed, PodcastFeed.Repo,
+#   username: "postgres",
+#   password: "postgres",
+#   database: "podcast_feed_test#{System.get_env("MIX_TEST_PARTITION")}",
+#   hostname: "localhost",
+#   pool: Ecto.Adapters.SQL.Sandbox
 
 # We don't run a server during test. If one is required,
 # you can enable the server option below.

+ 2 - 3
lib/podcast_feed.ex

@@ -8,9 +8,8 @@ defmodule PodcastFeed do
   """
   alias PodcastFeed.Provider.Archive
 
-  def archive() do
-    Archive.Parser.feed('https://ia601402.us.archive.org/8/items/incontri-a-piano-terra/incontri-a-piano-terra_files.xml') #FIXME: should be dynamic
-    |> IO.inspect
+  def archive(identifier) do
+    Archive.Parser.by_identifier(identifier)
   end
 end
 

+ 7 - 0
lib/podcast_feed/Utility/Format.ex

@@ -0,0 +1,7 @@
+defmodule PodcastFeed.Utility.Format do
+
+  def compile(subject, replacements) do
+    replacements
+    |> Enum.reduce(subject, fn {replacement_key, replacement_value}, subject -> String.replace(subject, "{#{replacement_key}}", replacement_value) end)
+  end
+end

+ 74 - 109
lib/podcast_feed/provider/archive/parser.ex

@@ -1,130 +1,95 @@
 defmodule PodcastFeed.Provider.Archive.Parser do
-  def feed(url) do
-    url
-    |> fetch_xml()
-    |> parse()
-    |> IO.inspect()
-    |> filter_mp3()
-    |> compose()
+  alias PodcastFeed.Utility.Format
+
+  @extra_metadata_url "https://archive.org/download/{identifier}/metadata.json"
+  @metadata_url "http://archive.org/metadata/{identifier}"
+  @download_url "https://archive.org/download/{identifier}/{filename}"
+
+  def by_identifier(identifier) do
+    extra_metadata_json = fetch_extra_metadata(identifier)
+    metadata_json = fetch_metadata(identifier)
+    parse(identifier, metadata_json, extra_metadata_json)
+  end
+
+  defp fetch_extra_metadata(identifier) do
+    extra_metadata_url = Format.compile(@extra_metadata_url, identifier: identifier)
+    {:ok, 200, _headers, client_ref} = :hackney.get(extra_metadata_url, [], "", [follow_redirect: true])
+    {:ok, extra_metadata_json} = :hackney.body(client_ref)
+    extra_metadata_json |> String.split("\n") |> Enum.join() |> Poison.decode!()
   end
 
-  defp fetch_xml(url) do
-    {:ok, {_, _, xml}} = :httpc.request(:get, {url, []}, [], [body_format: :binary])
-    xml
+  defp fetch_metadata(identifier) do
+    metadata_url = Format.compile(@metadata_url, identifier: identifier)
+    metadata_url |> IO.inspect
+    {:ok, 200, _headers, client_ref} = :hackney.get(metadata_url, [], "", [follow_redirect: true, connect_timeout: 30000, recv_timeout: 30000])
+    {:ok, metadata_json} = :hackney.body(client_ref)
+    metadata_json |> Poison.decode!()
+  end
+
+  def parse(identifier, %{"metadata" => metadata, "files" => files}, extra) do
+    _image = files |> fetch_image(identifier)
+
+    %{podcast: podcast_data(metadata, extra), items: items_data(files, identifier)}
   end
 
-  defp parse(xml) do
-    xml |> XmlToMap.naive_map() |> Map.get("files") |> Map.get("file") |> Enum.map(fn f -> Map.get(f, "#content") |> Map.put("filename", Map.get(f, "-name")) end)
+  defp fetch_image(files, identifier) do
+    filename = files
+    |> Enum.filter(fn f -> f["source"] == "original" end)
+    |> Enum.filter(fn f -> f["format"] == "JPEG" end) #FIXME:! jpg, png, gif
+    |> List.first()
+    |> Map.get("name")
+
+    Format.compile(@download_url, identifier: identifier, filename: filename) |> URI.encode()
   end
 
-  defp filter_mp3(files) do
-    files |> Enum.filter(fn f -> Map.get(f, "format") =~ ~r/MP3/i end)
+  defp podcast_data(metadata, extra) do
+    %{
+      title: metadata["title"],
+      description: metadata["description"],
+      webmaster: metadata["uploader"],
+      managingEditor: metadata["uploader"],
+      owner: %{
+        name: metadata["creator"],
+        email: metadata["uploader"],
+      },
+      keywords: metadata["subject"],
+      pubDate: metadata["publicdate"] |> NaiveDateTime.from_iso8601!() |> DateTime.from_naive!("Etc/UTC"),
+      lastBuildDate: metadata["addeddate"] |> NaiveDateTime.from_iso8601!() |> DateTime.from_naive!("Etc/UTC"),
+      author: metadata["creator"],
+      language: metadata["language"],
+      image: %{
+        url: extra["image"]["url"],
+        title: extra["image"]["title"],
+        link: extra["image"]["link"],
+      },
+      link: extra["link"],
+      category: extra["category"],
+      explicit: extra["explicit"],
+    }
   end
 
-  defp compose(files) do
+  defp items_data(files, identifier) do
     files
-    |> Enum.map(&to_feed_item/1)
+    |> filter_audio_files()
+    |> Enum.map(fn f -> to_feed_item(f, identifier) end)
   end
 
-    # <item>
-    #     <title>Episode Name 2</title>
-    #     <link>
-    #         http://podcast.example.com/episode2.mp4
-    #     </link>
-    #     <pubDate>Sat, 02 Jan 2016 16:00:00 PDT</pubDate>
-    #     <description>
-    #         The full length episode 2 description
-    #     </description>
-    #     <enclosure url="http://podcasts.example.com/episode.mp4" length="36715125" type="audio/mpeg"/>
-    #     <guid>
-    #         http://podcast.example.com/episode2.mp4
-    #     </guid>
-    #     <itunes:duration>19:07</itunes:duration>
-    #     <itunes:summary>
-    #         The full length episode 2 description
-    #     </itunes:summary>
-    #     <itunes:image href="http://www.example.com/image3000x3000.png"/>
-    #     <itunes:keywords>
-    #         comma,separated,key,words
-    #     </itunes:keywords>
-    #     <itunes:explicit>no</itunes:explicit>
-    # </item>
-# %{
-#     "album" => "Incontri al Piano Terra",
-#     "artist" => "APE Milano",
-#     "crc32" => "f1820595",
-#     "creator" => "APE Milano",
-#     "format" => "VBR MP3",
-#     "genre" => "podcast",
-#     "height" => "0",
-#     "length" => "3943.31",
-#     "md5" => "9ca26043a3e82e6f86c3a9309b88f4f5",
-#     "mtime" => "1590154757",
-#     "sha1" => "dcacfa46fcad1d656312784ad06886b5614c6420",
-#     "size" => "47148690",
-#     "title" => "Presentazione di Montagna femminile plurale con N1DM",
-#     "track" => "03",
-#     "width" => "0"
-#   }
+  defp filter_audio_files(files) do
+    files |> Enum.filter(fn f -> Map.get(f, "format") =~ ~r/MP3/i end) #FIXME:! mp3, ogg, boh
+  end
 
-  defp to_feed_item(file) do
+  defp to_feed_item(file, identifier) do
+    filename = Map.get(file, "name")
     %{
-      title: file |> Map.get("title"),
-      link: "http://archive.org/download/incontri-a-piano-terra/" <> (file |> Map.get("filename")) |> URI.encode(), #FIXME:! identifier should by dynamic
-      pubDate: file |> Map.get("mtime") |> Integer.parse() |> elem(0) |> DateTime.from_unix!(:second),
+      title: file["title"],
       description: "",
-      length: (file |> Map.get("length") |> Float.parse() |> elem(0)) * 100,
-      guid: "",
-      duration: "",
+      pubDate: file |> Map.get("mtime") |> Integer.parse() |> elem(0) |> DateTime.from_unix!(:second),
+      link: Format.compile(@download_url, identifier: identifier, filename: filename) |> URI.encode(),
+      length: (file |> Map.get("length") |> Float.parse() |> elem(0)) * 100 |> trunc(),
       summary: "",
-      image: "",
+      # image: "", #FIXME:! take the image from other files
       keywords: file |> Map.take(["album", "artist", "genre"]) |> Map.values(),
       explicit: "no",
     }
   end
 end
-
-# <?xml version="1.0" encoding="utf-8"?>
-# <rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:itunesu="http://www.itunesu.com/feed" version="2.0">
-# <channel>
-# <link>http://www.YourSite.com</link>
-# <language>en-us</language>
-# <copyright>&#xA9;2013</copyright>
-# <webMaster>your@email.com (Your Name)</webMaster>
-# <managingEditor>your@email.com (Your Name)</managingEditor>
-# <image>
-# <url>http://www.YourSite.com/ImageSize300X300.jpg</url>
-# <title>Title or description of your logo</title>
-# <link>http://www.YourSite.com</link>
-# </image>
-# <itunes:owner>
-# <itunes:name>Your Name</itunes:name>
-# <itunes:email>your@email.com</itunes:email>
-# </itunes:owner>
-# <itunes:category text="Education">
-# <itunes:category text="Higher Education" />
-# </itunes:category>
-# <itunes:keywords>separate, by, comma, and, space</itunes:keywords>
-# <itunes:explicit>no</itunes:explicit>
-# <itunes:image href="http://www.YourSite.com/ImageSize300X300.jpg" />
-# <atom:link href="http://www.YourSite.com/feed.xml" rel="self" type="application/rss+xml" />
-# <pubDate>Sun, 01 Jan 2012 00:00:00 EST</pubDate>
-# <title>Verbose title of the podcast</title>
-# <itunes:author>College, school, or department owning the podcast</itunes:author>
-# <description>Verbose description of the podcast.</description>
-# <itunes:summary>Duplicate of above verbose description.</itunes:summary>
-# <itunes:subtitle>Short description of the podcast - 255 character max.</itunes:subtitle>
-# <lastBuildDate>Thu, 02 Feb 2012 00:00:00 EST</lastBuildDate>
-# <item>
-# <title>Verbose title of the episode</title>
-# <description>Verbose description of the episode.</description>
-# <itunes:summary>Duplicate of above verbose description.</itunes:summary>
-# <itunes:subtitle>Short description of the episode - 255 character max.</itunes:subtitle>
-# <itunesu:category itunesu:code="112" />
-# <enclosure url="http://www.YourSite.com/FILE.EXT" type="audio/mpeg" length="1" />
-# <guid>http://www.YourSite.com/FILE.EXT</guid>
-# <itunes:duration>H:MM:SS</itunes:duration>
-# <pubDate>Thu, 02 Feb 2012 00:00:00 EST</pubDate>
-# </item>
-# </channel>
-# </rss>

+ 5 - 5
lib/podcast_feed/repo.ex

@@ -1,5 +1,5 @@
-defmodule PodcastFeed.Repo do
-  # use Ecto.Repo,
-  #   otp_app: :podcast_feed,
-  #   adapter: Ecto.Adapters.Postgres
-end
+# defmodule PodcastFeed.Repo do
+#   # use Ecto.Repo,
+#   #   otp_app: :podcast_feed,
+#   #   adapter: Ecto.Adapters.Postgres
+# end

+ 2 - 2
lib/podcast_feed_web/controllers/feed_controller.ex

@@ -2,9 +2,9 @@ defmodule PodcastFeedWeb.FeedController do
   use PodcastFeedWeb, :controller
 
   def apeMilano(conn, _params) do
-    items = PodcastFeed.archive()
+    %{podcast: podcast, items: items} = PodcastFeed.archive("incontri-a-piano-terra")
     conn
     |> put_resp_content_type("text/xml")
-    |> render("feed.xml", items: items)
+    |> render("feed.xml", podcast: podcast, items: items)
   end
 end

+ 1 - 1
lib/podcast_feed_web/endpoint.ex

@@ -32,7 +32,7 @@ defmodule PodcastFeedWeb.Endpoint do
     socket "/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket
     plug Phoenix.LiveReloader
     plug Phoenix.CodeReloader
-    plug Phoenix.Ecto.CheckRepoStatus, otp_app: :podcast_feed
+    # plug Phoenix.Ecto.CheckRepoStatus, otp_app: :podcast_feed
   end
 
   plug Phoenix.LiveDashboard.RequestLogger,

+ 22 - 23
lib/podcast_feed_web/templates/feed/feed.xml.eex

@@ -1,35 +1,34 @@
 <?xml version="1.0" encoding="utf-8"?>
 <rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:itunesu="http://www.itunesu.com/feed" version="2.0">
   <channel>
-    <link>http://www.ape-alveare.it/</link>
-    <language>en-us</language>
+    <link><%= @podcast.link %></link>
+    <language><%= @podcast.language %></language>
     <copyright>&#xA9;2022</copyright>
-    <webMaster>your@email.com (Your Name)</webMaster>
-    <managingEditor>your@email.com (Your Name)</managingEditor>
+    <webMaster><%= @podcast.webmaster %></webMaster>
+    <managingEditor><%= @podcast.webmaster %></managingEditor>
     <image>
-      <url>http://www.ape-alveare.it/wp-content/themes/yootheme/cache/2018_logo_Ape_righe_trasparenza-d1aae6b9.png</url>
-      <title>Ape-Milano-logo</title>
-      <link>http://www.ape-alveare.it/</link>
+      <url><%= @podcast.image.url %></url>
+      <title><%= @podcast.image.title %></title>
+      <link><%= @podcast.image.link %></link>
     </image>
     <itunes:owner>
-      <itunes:name>Ape Milano</itunes:name>
-      <itunes:email>your@email.com</itunes:email>
+      <itunes:name><%= @podcast.owner.name %></itunes:name>
+      <itunes:email><%= @podcast.owner.email %></itunes:email>
     </itunes:owner>
-    <itunes:category text="Education">
-      <itunes:category text="Higher Education" />
+    <itunes:category text="<%= @podcast.category %>">
+      <itunes:category text="<%= @podcast.category %>" />
     </itunes:category>
-    <itunes:keywords>separate, by, comma, and, space</itunes:keywords>
-    <itunes:explicit>no</itunes:explicit>
-    <itunes:image href="http://www.ape-alveare.it/wp-content/themes/yootheme/cache/2018_logo_Ape_righe_trasparenza-d1aae6b9.png" />
+    <itunes:keywords><%= "FIXME!!!" %></itunes:keywords>
+    <itunes:explicit><%= @podcast.explicit %></itunes:explicit>
+    <itunes:image href="<%= @podcast.image.url %>" />
     <atom:link href="http://www.ape-alveare.it/podcast.xml" rel="self" type="application/rss+xml" />
-    <pubDate>Sun, 01 Jan 2012 00:00:00 EST</pubDate>
-    <title>Verbose title of the podcast</title>
+    <pubDate><%= @podcast.pubDate |> Calendar.DateTime.Format.rfc2822 %></pubDate>
+    <title><%= @podcast.title %></title>
     <itunes:author>College, school, or department owning the podcast</itunes:author>
-    <description>Verbose description of the podcast.</description>
-    <itunes:summary>Duplicate of above verbose description.</itunes:summary>
-    <itunes:subtitle>Short description of the podcast - 255 character max.</itunes:subtitle>
-    <lastBuildDate>Thu, 02 Feb 2012 00:00:00 EST</lastBuildDate>
-
+    <description><%= @podcast.description %></description>
+    <itunes:summary><%= @podcast.description %></itunes:summary>
+    <itunes:subtitle><%= @podcast.description %></itunes:subtitle>
+    <lastBuildDate><%= @podcast.pubDate |> Calendar.DateTime.Format.rfc2822 %></lastBuildDate>
     <%= for item <- @items do %>
     <item>
       <title><%= item.title %></title>
@@ -43,6 +42,6 @@
       <itunes:keywords><%= item.keywords %></itunes:keywords>
       <itunes:explicit><%= item.explicit %></itunes:explicit>
     </item>
-    <%= end %>
+    <% end %>
   </channel>
-</rss>
+</rss>

+ 1 - 0
lib/podcast_feed_web/views/feed_view.ex

@@ -2,6 +2,7 @@ defmodule PodcastFeedWeb.FeedView do
   use PodcastFeedWeb, :view
 
   def format_length(length) do
+    length |> IO.inspect
     parsed = length / 100 / 60
     min = parsed |> trunc
     sec = parsed - min |> Float.floor(2) |> Float.to_string() |> String.split(".") |> Enum.at(1)

+ 5 - 2
mix.exs

@@ -47,7 +47,9 @@ defmodule PodcastFeed.MixProject do
       {:plug_cowboy, "~> 2.0"},
       {:elixir_xml_to_map, "~> 1.0"},
       {:calendar, "~> 1.0.0"},
-      {:distillery, "~> 2.0"}
+      {:distillery, "~> 2.0"},
+      {:poison, "~> 3.1"},
+      {:hackney, "~> 1.15"},
     ]
   end
 
@@ -62,7 +64,8 @@ defmodule PodcastFeed.MixProject do
       setup: ["deps.get", "ecto.setup", "cmd npm install --prefix assets"],
       "ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
       "ecto.reset": ["ecto.drop", "ecto.setup"],
-      test: ["ecto.create --quiet", "ecto.migrate --quiet", "test"]
+      # test: ["ecto.create --quiet", "ecto.migrate --quiet", "test"]
+      test: ["test"]
     ]
   end
 end

+ 1 - 0
mix.lock

@@ -31,6 +31,7 @@
   "plug": {:hex, :plug, "1.10.1", "c56a6d9da7042d581159bcbaef873ba9d87f15dce85420b0d287bca19f40f9bd", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "b5cd52259817eb8a31f2454912ba1cff4990bca7811918878091cb2ab9e52cb8"},
   "plug_cowboy": {:hex, :plug_cowboy, "2.2.1", "fcf58aa33227a4322a050e4783ee99c63c031a2e7f9a2eb7340d55505e17f30f", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3b43de24460d87c0971887286e7a20d40462e48eb7235954681a20cee25ddeb6"},
   "plug_crypto": {:hex, :plug_crypto, "1.1.2", "bdd187572cc26dbd95b87136290425f2b580a116d3fb1f564216918c9730d227", [:mix], [], "hexpm", "6b8b608f895b6ffcfad49c37c7883e8df98ae19c6a28113b02aa1e9c5b22d6b5"},
+  "poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], [], "hexpm", "fec8660eb7733ee4117b85f55799fd3833eb769a6df71ccf8903e8dc5447cfce"},
   "postgrex": {:hex, :postgrex, "0.15.4", "5d691c25fc79070705a2ff0e35ce0822b86a0ee3c6fdb7a4fb354623955e1aed", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "306515b9d975fcb2478dc337a1d27dc3bf8af7cd71017c333fe9db3a3d211b0a"},
   "ranch": {:hex, :ranch, "1.7.1", "6b1fab51b49196860b733a49c07604465a47bdb78aa10c1c16a3d199f7f8c881", [:rebar3], [], "hexpm", "451d8527787df716d99dc36162fca05934915db0b6141bbdac2ea8d3c7afc7d7"},
   "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.5", "6eaf7ad16cb568bb01753dbbd7a95ff8b91c7979482b95f38443fe2c8852a79b", [:make, :mix, :rebar3], [], "hexpm", "13104d7897e38ed7f044c4de953a6c28597d1c952075eb2e328bc6d6f2bfc496"},

File diff suppressed because it is too large
+ 6 - 0
test/podcast_feed/provider/archive/parser_test.exs


+ 9 - 0
test/podcast_feed/utility/format_test.exs

@@ -0,0 +1,9 @@
+defmodule PodcastFeed.Utility.FormatTest do
+  use ExUnit.Case
+
+  alias PodcastFeed.Utility.Format
+
+  test "Test placeholder are replaced" do
+    assert "http://foo/bar" == Format.compile("http://{host}/{path}", host: "foo", path: "bar")
+  end
+end

+ 4 - 4
test/support/channel_case.ex

@@ -29,11 +29,11 @@ defmodule PodcastFeedWeb.ChannelCase do
   end
 
   setup tags do
-    :ok = Ecto.Adapters.SQL.Sandbox.checkout(PodcastFeed.Repo)
+    # :ok = Ecto.Adapters.SQL.Sandbox.checkout(PodcastFeed.Repo)
 
-    unless tags[:async] do
-      Ecto.Adapters.SQL.Sandbox.mode(PodcastFeed.Repo, {:shared, self()})
-    end
+    # unless tags[:async] do
+    #   Ecto.Adapters.SQL.Sandbox.mode(PodcastFeed.Repo, {:shared, self()})
+    # end
 
     :ok
   end

+ 4 - 4
test/support/conn_case.ex

@@ -32,11 +32,11 @@ defmodule PodcastFeedWeb.ConnCase do
   end
 
   setup tags do
-    :ok = Ecto.Adapters.SQL.Sandbox.checkout(PodcastFeed.Repo)
+    # :ok = Ecto.Adapters.SQL.Sandbox.checkout(PodcastFeed.Repo)
 
-    unless tags[:async] do
-      Ecto.Adapters.SQL.Sandbox.mode(PodcastFeed.Repo, {:shared, self()})
-    end
+    # unless tags[:async] do
+    #   Ecto.Adapters.SQL.Sandbox.mode(PodcastFeed.Repo, {:shared, self()})
+    # end
 
     {:ok, conn: Phoenix.ConnTest.build_conn()}
   end

+ 12 - 12
test/support/data_case.ex

@@ -20,19 +20,19 @@ defmodule PodcastFeed.DataCase do
     quote do
       alias PodcastFeed.Repo
 
-      import Ecto
-      import Ecto.Changeset
-      import Ecto.Query
+      # import Ecto
+      # import Ecto.Changeset
+      # import Ecto.Query
       import PodcastFeed.DataCase
     end
   end
 
   setup tags do
-    :ok = Ecto.Adapters.SQL.Sandbox.checkout(PodcastFeed.Repo)
+    # :ok = Ecto.Adapters.SQL.Sandbox.checkout(PodcastFeed.Repo)
 
-    unless tags[:async] do
-      Ecto.Adapters.SQL.Sandbox.mode(PodcastFeed.Repo, {:shared, self()})
-    end
+    # unless tags[:async] do
+    #   Ecto.Adapters.SQL.Sandbox.mode(PodcastFeed.Repo, {:shared, self()})
+    # end
 
     :ok
   end
@@ -46,10 +46,10 @@ defmodule PodcastFeed.DataCase do
 
   """
   def errors_on(changeset) do
-    Ecto.Changeset.traverse_errors(changeset, fn {message, opts} ->
-      Regex.replace(~r"%{(\w+)}", message, fn _, key ->
-        opts |> Keyword.get(String.to_existing_atom(key), key) |> to_string()
-      end)
-    end)
+    # Ecto.Changeset.traverse_errors(changeset, fn {message, opts} ->
+    #   Regex.replace(~r"%{(\w+)}", message, fn _, key ->
+    #     opts |> Keyword.get(String.to_existing_atom(key), key) |> to_string()
+    #   end)
+    # end)
   end
 end

+ 1 - 1
test/test_helper.exs

@@ -1,2 +1,2 @@
 ExUnit.start()
-Ecto.Adapters.SQL.Sandbox.mode(PodcastFeed.Repo, :manual)
+# Ecto.Adapters.SQL.Sandbox.mode(PodcastFeed.Repo, :manual)

Some files were not shown because too many files changed in this diff