Files
velour/app/models/concerns/processable.rb
Dan Milne 88a906064f
Some checks failed
CI / scan_ruby (push) Has been cancelled
CI / scan_js (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
CI / system-test (push) Has been cancelled
Much base work started
2025-10-31 14:36:14 +11:00

26 lines
531 B
Ruby

module Processable
extend ActiveSupport::Concern
included do
scope :processing_pending, -> { where("video_metadata->>'duration' IS NULL") }
end
def processed?
duration.present?
end
def processing_pending?
!processed? && processing_errors.blank?
end
def mark_processing_failed!(error_message)
self.processing_errors = [error_message]
save!
end
def retry_processing!
self.processing_errors = []
save!
# VideoProcessorJob.perform_later(id) - will be implemented later
end
end