woody-decorators 5.2.1 → 5.3.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/video.rb +17 -9
- data/lib/woody/decorators.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25428564c4b61fed1c7bbeefac1630708656b964
|
4
|
+
data.tar.gz: c8e3a4b20cac61371d3f0f4b5e4bdb2b99939c51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a88ba49a5ee24e4d16a6a409731547b98d6cb2afac78d5a806668ae1c3d4150bc18fc4a1fa40e51a24e6800d82d78e78917be567e043e8af851df30b63743200
|
7
|
+
data.tar.gz: 6ba4525d746f4d852d96dd69cada6c4c889ff7cd0fe80a98df7e63b571bbe9a875ab6055ff6190b345c367999f43d8af297763f0889551deb31556331e5e0489
|
@@ -43,6 +43,7 @@ module Woody
|
|
43
43
|
|
44
44
|
def gif
|
45
45
|
return 'https://i.imgur.com/jZCPUYx.gif' if dev?
|
46
|
+
return 'processing_image' unless states?('gif')
|
46
47
|
video_transcoding_state('gif').path(
|
47
48
|
filename_hash,
|
48
49
|
nil,
|
@@ -52,6 +53,7 @@ module Woody
|
|
52
53
|
|
53
54
|
def thumbnail
|
54
55
|
return 'https://i.imgur.com/jZCPUYx.gif' if dev?
|
56
|
+
return 'processing_image' unless states?('gif')
|
55
57
|
video_transcoding_state('gif').path(
|
56
58
|
filename_hash,
|
57
59
|
'thumbnail',
|
@@ -61,25 +63,18 @@ module Woody
|
|
61
63
|
|
62
64
|
def processed?
|
63
65
|
return true if dev?
|
66
|
+
return false unless states?('gif') && states?('mp4')
|
64
67
|
type_processed?('gif') && type_processed?('mp4')
|
65
68
|
end
|
66
69
|
|
67
70
|
def url
|
68
71
|
return dev_url if dev?
|
72
|
+
return 'processing_video' unless states?('mp4')
|
69
73
|
video_transcoding_state('mp4').path(filename_hash)
|
70
74
|
end
|
71
75
|
|
72
76
|
private
|
73
77
|
|
74
|
-
def processing_image
|
75
|
-
format(
|
76
|
-
'%s/%s/shared/video_processing/%s.jpg',
|
77
|
-
app_config['s3_domain'],
|
78
|
-
app_config['public_s3_bucket'],
|
79
|
-
rand(1...5)
|
80
|
-
)
|
81
|
-
end
|
82
|
-
|
83
78
|
def app_config
|
84
79
|
@app_config ||= @config.app
|
85
80
|
end
|
@@ -105,6 +100,19 @@ module Woody
|
|
105
100
|
@model.current_version.file_name.split('.').first
|
106
101
|
end
|
107
102
|
|
103
|
+
def processing_image
|
104
|
+
format(
|
105
|
+
'%s/%s/shared/video_processing/%s.jpg',
|
106
|
+
app_config['s3_domain'],
|
107
|
+
app_config['public_s3_bucket'],
|
108
|
+
rand(1...5)
|
109
|
+
)
|
110
|
+
end
|
111
|
+
|
112
|
+
def states?(type)
|
113
|
+
!@model.transcoding_state(type).nil?
|
114
|
+
end
|
115
|
+
|
108
116
|
def submission
|
109
117
|
@submission ||= Wes::Data::API::Submission.find(
|
110
118
|
:id, @model.submission_id
|
data/lib/woody/decorators.rb
CHANGED