           item = %{item | orig_feed_title: data["origin"]["title"]}
           Repo.insert!(Item.changeset(%Item{}, item))
         end
+      end
+
+      Repo.delete_all(from m in Media, where: m.item_id == ^saved_item.id)
+
+      if data["enclosure"] do
+        Enum.each(data["enclosure"], fn(enclosure) ->
+          Repo.insert!(Media.changeset(%Media{}, %{
+            item_id: saved_item.id,
+            url: enclosure["href"],
+            type: enclosure["type"],
+          }))
+        end)
       end
     end)
   end

  end

  defp import_items(conn, file) do
    require Poison
    require Timex
    alias Exagg.Item
    alias Exagg.Feed
    import Paratize.Pool

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

            feed_id: feed.id,
          }

          {:ok, saved_item} = Repo.transaction fn ->
            existing = Repo.one(from i in Item, where: i.guid == ^item.guid and i.user_id == ^item.user_id and i.feed_id == ^item.feed_id)

            if existing != nil do
