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 +4 -4
- data/lib/woody/decorators.rb +1 -1
- data/lib/woody/decorators/video.rb +21 -6
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2da9acc003d48845d49eb7f88b35544f4453b76f
|
4
|
+
data.tar.gz: 5171e8889a006a9d5a15454fad35b880f7614027
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2f32c5e14f56e5ad1e5d60c5304b9dd34e28f892ed0f0df3b310c08f653290a65886e932ac76e26b48c32cad96fc34a7edad8cb7cae19cd626a4c76f7931079
|
7
|
+
data.tar.gz: e3b626abc98eb73386a6a2f53f045c5c7794d76b030a3b1f3b9b92611dd21b47f67c1912e1a381bddee43360637e95c2941b4786508b698422d23a63f86ba860
|
data/lib/woody/decorators.rb
CHANGED
@@ -19,8 +19,8 @@ module Woody
|
|
19
19
|
|
20
20
|
def aspect_ratio
|
21
21
|
@aspect_ratio ||= Helper::AspectRatio.new(
|
22
|
-
|
23
|
-
|
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
|
-
|
114
|
+
original_version.url_path
|
107
115
|
)
|
108
116
|
end
|
109
117
|
|
110
118
|
def filename_hash
|
111
|
-
|
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
|
-
|
141
|
-
|
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.
|
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
|
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.
|
210
|
+
rubygems_version: 2.5.2
|
211
211
|
signing_key:
|
212
212
|
specification_version: 4
|
213
213
|
summary: ''
|