woody-decorators 12.0.0 → 12.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3f61b8d01d8c43e5e58cb1c30797b2beca64d831
4
- data.tar.gz: 94e78c139b6a70a27fa07a176e284d8690190785
3
+ metadata.gz: 2da9acc003d48845d49eb7f88b35544f4453b76f
4
+ data.tar.gz: 5171e8889a006a9d5a15454fad35b880f7614027
5
5
  SHA512:
6
- metadata.gz: 6d35c9215b4f3550ed916fd7821a00e0b28d5caaa5521ebf3c0aa41360f0a91276fa91ba3e281b7dab176d2e1e5ceb8fbfb27dade8995876b74b46645ff96e11
7
- data.tar.gz: 41774494b3267416123e5542b40149653990e72a46e632e65abeef79e22121c88e3f33a6420baf0ff93b3f85fc82878cc7ca9e791524d1cfd623dd002f9581b4
6
+ metadata.gz: e2f32c5e14f56e5ad1e5d60c5304b9dd34e28f892ed0f0df3b310c08f653290a65886e932ac76e26b48c32cad96fc34a7edad8cb7cae19cd626a4c76f7931079
7
+ data.tar.gz: e3b626abc98eb73386a6a2f53f045c5c7794d76b030a3b1f3b9b92611dd21b47f67c1912e1a381bddee43360637e95c2941b4786508b698422d23a63f86ba860
@@ -1,5 +1,5 @@
1
1
  module Woody
2
2
  module Decorators
3
- VERSION = '12.0.0'.freeze
3
+ VERSION = '12.1.0'.freeze
4
4
  end
5
5
  end
@@ -19,8 +19,8 @@ module Woody
19
19
 
20
20
  def aspect_ratio
21
21
  @aspect_ratio ||= Helper::AspectRatio.new(
22
- @model.current_version.height,
23
- @model.current_version.width
22
+ original_version.height,
23
+ original_version.width
24
24
  ).class_name
25
25
  end
26
26
 
@@ -44,6 +44,14 @@ module Woody
44
44
  )
45
45
  end
46
46
 
47
+ def original_version
48
+ @original_version ||= Wes::Data::API::Model::VideoVersion.new(
49
+ @model.versions.sort do |a,b|
50
+ DateTime.parse(a['created_at']) <=> DateTime.parse(b['created_at'])
51
+ end.first
52
+ )
53
+ end
54
+
47
55
  def error?
48
56
  @model.attributes.transcoding_states.map do |transcoding_state|
49
57
  if transcoding_state['state'] == "error"
@@ -103,12 +111,12 @@ module Woody
103
111
  '%s/%s/%s',
104
112
  app_config['s3_domain'],
105
113
  app_config['private_s3_bucket'],
106
- @model.current_version.url_path
114
+ original_version.url_path
107
115
  )
108
116
  end
109
117
 
110
118
  def filename_hash
111
- @model.current_version.file_name.split('.').first
119
+ original_version.file_name.split('.').first
112
120
  end
113
121
 
114
122
  def processing_image
@@ -137,8 +145,15 @@ module Woody
137
145
  end
138
146
 
139
147
  def video_transcoding_state(type)
140
- VideoTranscodingState.new(
141
- @model.transcoding_state(type), @config
148
+ return nil unless original_version
149
+ transcoding_state = Wes::Data::API::VideoTranscodingState.find(
150
+ id,
151
+ original_version.id,
152
+ type
153
+ )
154
+
155
+ Woody::Decorators::VideoTranscodingState.new(
156
+ transcoding_state, @config
142
157
  )
143
158
  end
144
159
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: woody-decorators
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.0.0
4
+ version: 12.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-22 00:00:00.000000000 Z
11
+ date: 2018-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -207,7 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
207
207
  version: '0'
208
208
  requirements: []
209
209
  rubyforge_project:
210
- rubygems_version: 2.5.1
210
+ rubygems_version: 2.5.2
211
211
  signing_key:
212
212
  specification_version: 4
213
213
  summary: ''