             end
           end
 
+          Repo.delete_all(from m in Media, where: m.item_id == ^saved_item.id)
+
+          if entry["attachment_url"] do
+            Repo.insert!(Media.changeset(%Media{}, %{
+              item_id: saved_item.id,
+              url: entry["attachment_url"],
+              type: "Download file",
+            }))
+          end
+
+          if entry["medias"] do
+            for {type, url} <- entry["medias"] do
+              Repo.insert!(Media.changeset(%Media{}, %{
+                item_id: saved_item.id,
+                url: url,
+                type: type,
+              }))
+            end
+          end
+
           Repo.update_unread_count(feed)
         end)
       end

        end)
      end

      # TODO: Add medias import
      #if data["enclosure"] do
      #  item.medias = Enum.map(data["enclosure"], fn(enclosure) ->
      #    medias[enclosure["type"]] = enclosure["href"]
      #  end)
      #end

      Repo.transaction fn ->
        feed_url = data["origin"]["streamId"] |> String.slice(5..-1)
        feed = Feed |> Repo.filter(conn) |> Ecto.Query.where([f], f.url == ^feed_url) |> Repo.one
        if feed != nil do

  end

  defp import_items(conn, file) do
    import Paratize.Pool

    json = File.read!(file.path) |> Poison.decode!
