wes-data-api 5.5.0 → 5.6.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1237c0bc989faa7594f124be26c50d83c2cb3d8c
|
4
|
+
data.tar.gz: 7822b30ed72f13bfb1b6325d5d231e7251288a4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ed0209489e5184115a86e7720a76cb9c6ae3e0936e30e3f901091975cf2c0a42835132c2df96a46bf3b1c9800439a58e948b9dfc609f092109cb76752bc9127
|
7
|
+
data.tar.gz: d8fabd52644beebdf5fabd386cc147acda63ae769b3b07c4116ed1b9d0edf8ebbb2d834664f563fe917cdf34325532ee95143a2894f2d2bb07aa2423efda3a0a
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require "wes/data/api/model/base"
|
2
2
|
require "wes/data/api/model/creator_user"
|
3
|
+
require "wes/data/api/model/video_transcoding_state"
|
3
4
|
|
4
5
|
module Wes
|
5
6
|
module Data
|
@@ -13,38 +14,12 @@ module Wes
|
|
13
14
|
: Wes::Data::API::Model::CreatorUser.new(attributes)
|
14
15
|
end
|
15
16
|
|
16
|
-
def gif
|
17
|
-
@gif_state ||= video_state("gif", ".gif")
|
18
|
-
end
|
19
|
-
|
20
17
|
def set_caption(edit)
|
21
18
|
update(:caption => edit)
|
22
19
|
end
|
23
20
|
|
24
|
-
def thumbnail
|
25
|
-
@thumbnail_state ||= video_state("gif", "_00001.png")
|
26
|
-
end
|
27
|
-
|
28
|
-
def web_format
|
29
|
-
@web_state ||= video_state("mp4", ".mp4")
|
30
|
-
end
|
31
|
-
|
32
|
-
private
|
33
|
-
|
34
|
-
def filename_hash
|
35
|
-
file_name.split(".").first
|
36
|
-
end
|
37
|
-
|
38
|
-
def filename_suffix
|
39
|
-
configuration.transcoded_video_filename_suffix
|
40
|
-
end
|
41
|
-
|
42
|
-
def generate_filename(suffix)
|
43
|
-
"#{filename_hash}/#{filename_suffix}#{suffix}"
|
44
|
-
end
|
45
|
-
|
46
21
|
def update(changes)
|
47
|
-
route = [routes.
|
22
|
+
route = [routes.video, id].join("/")
|
48
23
|
@attributes = client.put(
|
49
24
|
route, @attributes.to_h.merge(changes)
|
50
25
|
).first
|
@@ -52,14 +27,11 @@ module Wes
|
|
52
27
|
self
|
53
28
|
end
|
54
29
|
|
55
|
-
def
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
def video_transcoded?(video_state)
|
62
|
-
video_state && video_state.state == "complete"
|
30
|
+
def transcoding_state(type)
|
31
|
+
Wes::Data::API::VideoTranscodingState.find(
|
32
|
+
id,
|
33
|
+
type
|
34
|
+
)
|
63
35
|
end
|
64
36
|
end
|
65
37
|
end
|
data/lib/wes/data/api/routes.rb
CHANGED
@@ -5,21 +5,22 @@ module Wes
|
|
5
5
|
class << self
|
6
6
|
def hash
|
7
7
|
OpenStruct.new(
|
8
|
-
:billing
|
9
|
-
:brand
|
10
|
-
:brand_user
|
11
|
-
:brands
|
12
|
-
:challenge
|
13
|
-
:challenges
|
14
|
-
:collectives
|
15
|
-
:creator_user
|
16
|
-
:creator_users
|
17
|
-
:rewards
|
18
|
-
:reward
|
19
|
-
:submission
|
20
|
-
:submissions
|
21
|
-
:video
|
22
|
-
:videos
|
8
|
+
:billing => "billing",
|
9
|
+
:brand => "brand",
|
10
|
+
:brand_user => "brand-user",
|
11
|
+
:brands => "brands",
|
12
|
+
:challenge => "challenge",
|
13
|
+
:challenges => "challenges",
|
14
|
+
:collectives => "collectives",
|
15
|
+
:creator_user => "creator-user",
|
16
|
+
:creator_users => "creator-users",
|
17
|
+
:rewards => "rewards",
|
18
|
+
:reward => "reward",
|
19
|
+
:submission => "submission",
|
20
|
+
:submissions => "submissions",
|
21
|
+
:video => "video",
|
22
|
+
:videos => "videos",
|
23
|
+
:transcoding_state => "transcoding-state"
|
23
24
|
)
|
24
25
|
end
|
25
26
|
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require "wes/data/api/base"
|
2
|
+
require "wes/data/api/model/video_transcoding_state"
|
3
|
+
|
4
|
+
module Wes
|
5
|
+
module Data
|
6
|
+
module API
|
7
|
+
class VideoTranscodingState
|
8
|
+
class << self
|
9
|
+
include Base
|
10
|
+
|
11
|
+
def find(video_id, type)
|
12
|
+
attributes = data(video_id, type).first
|
13
|
+
attributes.nil? ? nil : model_klass.new(attributes)
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def data(video_id, type)
|
19
|
+
client.get(route(video_id, type))
|
20
|
+
end
|
21
|
+
|
22
|
+
def route(video_id, type)
|
23
|
+
[routes.video, video_id, routes.transcoding_state, type].join("/")
|
24
|
+
end
|
25
|
+
|
26
|
+
def model_klass
|
27
|
+
Wes::Data::API::Model::VideoTranscodingState
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/wes/data/api.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wes-data-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -138,12 +138,14 @@ files:
|
|
138
138
|
- lib/wes/data/api/model/reward.rb
|
139
139
|
- lib/wes/data/api/model/submission.rb
|
140
140
|
- lib/wes/data/api/model/video.rb
|
141
|
+
- lib/wes/data/api/model/video_transcoding_state.rb
|
141
142
|
- lib/wes/data/api/request.rb
|
142
143
|
- lib/wes/data/api/response.rb
|
143
144
|
- lib/wes/data/api/reward.rb
|
144
145
|
- lib/wes/data/api/routes.rb
|
145
146
|
- lib/wes/data/api/submission.rb
|
146
147
|
- lib/wes/data/api/video.rb
|
148
|
+
- lib/wes/data/api/video_transcoding_state.rb
|
147
149
|
- wes-data-api.gemspec
|
148
150
|
homepage: ''
|
149
151
|
licenses: []
|