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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0139ad37b2dd161b93b2049c589b003831a959bc
4
- data.tar.gz: 90957e582174bb1894602964965247a76e1e727a
3
+ metadata.gz: 25428564c4b61fed1c7bbeefac1630708656b964
4
+ data.tar.gz: c8e3a4b20cac61371d3f0f4b5e4bdb2b99939c51
5
5
  SHA512:
6
- metadata.gz: f59fd3e16aec9ab6dd6a17e3fb2e2e8aa0ee4f9911fb02abbd12baa42c0037c27d61661442d9d579335ed9fd73acbb77a880e0f814cfdd7e9d7372db7dec58ba
7
- data.tar.gz: 5eea179abf6acc72c9d1cc5fab80f3a156ab50b2a1f67fa0bc7381f8ce81898dc4f18f79c9fb45cd09f999379278d0794f86b06f8d478b57013ac1c15e6712ed
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
@@ -1,5 +1,5 @@
1
1
  module Woody
2
2
  module Decorators
3
- VERSION = '5.2.1'.freeze
3
+ VERSION = '5.3.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: woody-decorators
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.1
4
+ version: 5.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''