module Public
  class ReplayController < SiteBaseController
    layout "marketing_live"

    def show
      @session = StreamSession.includes(match: :team).find(params[:id])
      @recording = Recording.ready.find_by(stream_session: @session)
      @match = @session.match

      unless @recording
        redirect_to public_live_path(@session), alert: "Replay non disponibile"
      end
    end
  end
end
