Files
MatchLiveTv/backend/app/services/sessions/pause.rb
Emiliano Frascaro bba6df52c0 Initial commit: monorepo Match Live TV.
Rails API, app Flutter, infrastruttura Docker/MediaMTX, sito marketing e documentazione di deploy.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-26 17:45:37 +02:00

21 lines
445 B
Ruby

module Sessions
class Pause
def initialize(session)
@session = session
end
def call
@session.pause! if @session.may_pause?
log_event("paused")
SessionChannel.broadcast_message(@session, { type: "command", action: "pause_stream" })
@session
end
private
def log_event(type)
@session.stream_events.create!(event_type: type, occurred_at: Time.current, metadata: {})
end
end
end