Skip to content

Commit

Permalink
warn edit
Browse files Browse the repository at this point in the history
  • Loading branch information
jwellnit committed Jan 24, 2025
1 parent 16ee985 commit 22ceec6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions app/services/spot/derivatives/video_derivative_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@ def check_premade_derivatives(filename)
base_file = filename.to_s.split('/')[-1].split('.')[0]
project_name = base_file.split('_')[0]
prefix = project_name + "/" + base_file + "_derivative"
Rails.logger.error('Derivative Prefix: ' + prefix)
Rails.logger.warn { 'Derivative Prefix: ' + prefix }
object_list = s3_client.list_objects(bucket: s3_source, prefix: prefix).to_h[:contents]
Rails.logger.error('Derivative list size: ' + object_list.length.to_s)

return false if object_list.nil?

Rails.logger.warn { 'Derivative list size: ' + object_list.length.to_s }

premade_derivatives = []
object_list.each do |object|
premade_derivatives.push(object[:key])
Expand Down Expand Up @@ -81,15 +82,15 @@ def check_transcript(filename)
base_file = filename.to_s.split('/')[-1].split('.')[0]
project_name = base_file.split('_')[0]
transcript_name = project_name + "/" + base_file + "_caption.vtt"
Rails.logger.error('Transcript Name: ' + transcript_name)
Rails.logger.warn { 'Transcript Name: ' + transcript_name }
begin
s3_client.head_object(bucket: s3_source, key: transcript_name)
rescue Aws::S3::Errors::NotFound
Rails.logger.error('Transcript not found.')
Rails.logger.warn('Transcript not found.') { 'Transcript not found.' }
else
# enqueue job
Spot::TranscriptJob.perform_later(file_set: file_set, transcript_name: transcript_name)
Rails.logger.error('Transcript job enqueued.')
Rails.logger.warn { 'Transcript job enqueued.' }
end
end

Expand Down

0 comments on commit 22ceec6

Please sign in to comment.