Aggiunge modulo Replay, Garage dev e YouTube a livello società.
Pipeline registrazione/upload con storage S3, archivio web e app, proxy replay per il browser, OAuth YouTube sulla pagina club (Premium Full) e footer legale. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
29
backend/app/services/recordings/notify_ready.rb
Normal file
29
backend/app/services/recordings/notify_ready.rb
Normal file
@@ -0,0 +1,29 @@
|
||||
module Recordings
|
||||
class NotifyReady
|
||||
def initialize(recording)
|
||||
@recording = recording
|
||||
end
|
||||
|
||||
def call
|
||||
return @recording if @recording.ready_notified_at.present?
|
||||
return @recording unless @recording.ready?
|
||||
|
||||
recipients.each do |user|
|
||||
Recordings::ReplayMailer.replay_ready(recording: @recording, recipient: user).deliver_now
|
||||
end
|
||||
|
||||
@recording.update!(ready_notified_at: Time.current)
|
||||
@recording
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def recipients
|
||||
club = @recording.team.club
|
||||
owner = club.owner
|
||||
users = club.users.distinct.to_a
|
||||
users << owner if owner && users.none? { |u| u.id == owner.id }
|
||||
users.uniq.select { |u| u.email.present? }
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user