staugaard-transcoding_machine 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/lib/transcoding_machine/client/result_queue.rb +3 -2
- data/lib/transcoding_machine/server/file_storage.rb +1 -0
- data/lib/transcoding_machine/server/s3_storage.rb +1 -0
- data/lib/transcoding_machine/server/transcoder.rb +4 -3
- data/lib/transcoding_machine/server/transcoding_event_listener.rb +1 -1
- metadata +1 -1
data/VERSION.yml
CHANGED
@@ -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
|
@@ -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
|
-
|
122
|
-
|
123
|
-
|
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
|