   def do_show(conn, "html", asciicast) do
     conn
     |> count_view(asciicast)
+    |> put_archival_info_flash(asciicast)
     |> render(
       "show.html",
       page_title: AsciinemaWeb.AsciicastView.title(asciicast),

defmodule AsciinemaWeb.AsciicastController do
  use AsciinemaWeb, :controller
  alias Asciinema.{Asciicasts, PngGenerator}
  alias Asciinema.Asciicasts.Asciicast

  plug :put_layout, "app2.html"

      _ -> true
    end
  end

  defp put_archival_info_flash(conn, asciicast) do
    with days when not is_nil(days) <- Asciicasts.gc_days(),
         %{} = user <- asciicast.user,
         true <- Accounts.temporary_user?(user),
         true <- Timex.before?(asciicast.created_at, Timex.shift(Timex.now(), days: -days)) do
      put_flash(conn, :error, {:safe, "This recording will be archived soon. More details: <a href=\"https://blog.asciinema.org/post/archival/\">blog.asciinema.org/post/archival/</a>"})
    else
      _ -> conn
    end
  end
end
