wes-data-api 5.4.0 → 5.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/wes/data/api/model/video.rb +23 -15
- data/lib/wes/data/api.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: 40810ee00b791376c6280505b3acf8485e7d4629
|
4
|
+
data.tar.gz: 63b74d7d0f071cd04f2a761b4c1e530872d04102
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70e0ad5c5071d1b6e36b46f739eb313d8e5eada0781970ec56d8e76d8ba768bd538214e82fc8a0456ec6e07eb705b9048294ea3c9e08c57e1b798630d6108d48
|
7
|
+
data.tar.gz: 332c28b217286178d87f7787574b6146899f50dc219b3c74c5b86f3f79924b910d9d0a67a99bd706bb467cf8682d344f91562fcaa3990ad779670b7381e3b2b5
|
@@ -1,10 +1,22 @@
|
|
1
1
|
require "wes/data/api/model/base"
|
2
|
+
require "wes/data/api/model/creator_user"
|
2
3
|
|
3
4
|
module Wes
|
4
5
|
module Data
|
5
6
|
module API
|
6
7
|
module Model
|
7
8
|
class Video < Base
|
9
|
+
def creator_user
|
10
|
+
route = [routes.video, id, routes.creator_user].join("/")
|
11
|
+
attributes = client.get(route).first
|
12
|
+
attributes.nil? ? nil
|
13
|
+
: Wes::Data::API::Model::CreatorUser.new(attributes)
|
14
|
+
end
|
15
|
+
|
16
|
+
def gif
|
17
|
+
@gif_state ||= video_state("gif", ".gif")
|
18
|
+
end
|
19
|
+
|
8
20
|
def set_caption(edit)
|
9
21
|
update(:caption => edit)
|
10
22
|
end
|
@@ -17,11 +29,19 @@ module Wes
|
|
17
29
|
@web_state ||= video_state("mp4", ".mp4")
|
18
30
|
end
|
19
31
|
|
20
|
-
|
21
|
-
|
32
|
+
private
|
33
|
+
|
34
|
+
def filename_hash
|
35
|
+
file_name.split(".").first
|
22
36
|
end
|
23
37
|
|
24
|
-
|
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
|
25
45
|
|
26
46
|
def update(changes)
|
27
47
|
route = [routes.billing, id].join("/")
|
@@ -41,18 +61,6 @@ module Wes
|
|
41
61
|
def video_transcoded?(video_state)
|
42
62
|
video_state && video_state.state == "complete"
|
43
63
|
end
|
44
|
-
|
45
|
-
def generate_filename(suffix)
|
46
|
-
"#{filename_hash}/#{filename_suffix}#{suffix}"
|
47
|
-
end
|
48
|
-
|
49
|
-
def filename_hash
|
50
|
-
file_name.split(".").first
|
51
|
-
end
|
52
|
-
|
53
|
-
def filename_suffix
|
54
|
-
configuration.transcoded_video_filename_suffix
|
55
|
-
end
|
56
64
|
end
|
57
65
|
end
|
58
66
|
end
|
data/lib/wes/data/api.rb
CHANGED