staugaard-transcoding_machine 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- :patch: 4
2
+ :patch: 5
3
3
  :major: 0
4
4
  :minor: 1
@@ -2,9 +2,10 @@ require 'right_aws'
2
2
 
3
3
  module TranscodingMachine
4
4
  class ResultQueue
5
- def initialize
5
+ def initialize(logger = nil)
6
6
  @sqs = RightAws::SqsGen2.new
7
7
  @consuming = false
8
+ @logger = logger
8
9
  end
9
10
 
10
11
  def start_consuming(queue_names, &block)
@@ -37,7 +38,7 @@ module TranscodingMachine
37
38
  begin
38
39
  yield(message_properties)
39
40
  rescue Exception => e
40
-
41
+ @logger.error(e) if @logger
41
42
  end
42
43
 
43
44
  @last_active_at = Time.now
@@ -17,6 +17,7 @@ module TranscodingMachine
17
17
 
18
18
  def put_thumbnail_file(thumbnail_file_path, source_file, options)
19
19
  FileUtils.mv(thumbnail_file_path.path, @root)
20
+ thumbnail_file_path.path
20
21
  end
21
22
  end
22
23
  end
@@ -29,6 +29,7 @@ module TranscodingMachine
29
29
  destination_key = RightAws::S3::Key.create(@s3.bucket(options[:bucket]), "#{source_file_key_name}.thumb.jpg")
30
30
  destination_key.put(thumbnail_file, 'public-read', 'Content-Type' => 'image/jpg')
31
31
  FileUtils.rm(thumbnail_file.path)
32
+ destination_key.name
32
33
  end
33
34
  end
34
35
  end
@@ -118,9 +118,10 @@ module TranscodingMachine
118
118
  end
119
119
 
120
120
  def put_destination_file(file_path, media_format)
121
- @event_handler.putting_destination_file(file_path, media_format) if @event_handler
122
- storage.put_file(destination_file_path(media_format), destination_file_name(media_format), media_format, @storage_options)
123
- @event_handler.put_destination_file(file_path, media_format) if @event_handler
121
+ dst_name = destination_file_name(media_format)
122
+ @event_handler.putting_destination_file(dst_name, media_format) if @event_handler
123
+ storage.put_file(destination_file_path(media_format), dst_name, media_format, @storage_options)
124
+ @event_handler.put_destination_file(dst_name, media_format) if @event_handler
124
125
  end
125
126
 
126
127
  def clear
@@ -21,7 +21,7 @@ module TranscodingMachine
21
21
  end
22
22
 
23
23
  def analyzed_source_file(source_file_attributes, source_media_format, target_media_formats)
24
- push_status(:analyzed, :media_format => source_media_format.id,
24
+ push_status(:analyzed, :media_format => source_media_format ? source_media_format.id : nil,
25
25
  :media_attributes => source_file_attributes,
26
26
  :target_formats => target_media_formats.map(&:id))
27
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: staugaard-transcoding_machine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mick Staugaard