wcc-media-client 0.4.9 → 0.4.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wcc/media/client.rb +4 -2
- data/lib/wcc/media/client/response.rb +1 -1
- data/lib/wcc/media/live_stream.rb +48 -0
- data/lib/wcc/media/message.rb +5 -0
- data/lib/wcc/media/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7acce9b696288c4c5a1a7f1d6f6c0a0f20331a1a
|
4
|
+
data.tar.gz: 1f498be5b915ebcf9de02d9c4ac02ccabb700c11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b30e2fec462e1b75e064328cee511d560299d05456a69ad3c5f9539a16813c60a7f827b7ff84477c30477d2527d6a7265e1a77bfbb2ae6ab6af7522d077bd0d2
|
7
|
+
data.tar.gz: 9ab9fe2f4296aa73178cff5c6eabced2e82e674da361ae36838e610ce7c74f0d8d7a8ccf778b2bcb4c8bb46cc77c5b03978b22d45903c5805c728bb7879b9546
|
data/lib/wcc/media/client.rb
CHANGED
@@ -4,6 +4,7 @@ require_relative 'series'
|
|
4
4
|
require_relative 'speaker'
|
5
5
|
require_relative 'tag'
|
6
6
|
require_relative 'playlist'
|
7
|
+
require_relative 'live_stream'
|
7
8
|
require_relative 'client/response'
|
8
9
|
|
9
10
|
module WCC
|
@@ -35,7 +36,8 @@ module WCC
|
|
35
36
|
'series' => WCC::Media::Series,
|
36
37
|
'speakers' => WCC::Media::Speaker,
|
37
38
|
'tags' => WCC::Media::Tag,
|
38
|
-
'playlists' => WCC::Media::Playlist
|
39
|
+
'playlists' => WCC::Media::Playlist,
|
40
|
+
'streams' => WCC::Media::LiveStream
|
39
41
|
}.freeze
|
40
42
|
attr_reader(*RESOURCES.keys)
|
41
43
|
|
@@ -61,7 +63,7 @@ module WCC
|
|
61
63
|
|
62
64
|
resp = client.get(
|
63
65
|
"#{model.endpoint}/#{id}",
|
64
|
-
default_params('target').merge(params)
|
66
|
+
default_params('target').merge(params),
|
65
67
|
)
|
66
68
|
resp.assert_ok!
|
67
69
|
model.new(resp.body[model.key], resp.headers.freeze)
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class WCC::Media::LiveStream < WCC::Media::Base
|
4
|
+
active_record_shim do
|
5
|
+
endpoint 'streams'
|
6
|
+
key 'stream'
|
7
|
+
filters %w[
|
8
|
+
].freeze
|
9
|
+
end
|
10
|
+
|
11
|
+
%w[
|
12
|
+
title
|
13
|
+
description
|
14
|
+
].each do |att|
|
15
|
+
define_method att do
|
16
|
+
raw[att]
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
%w[
|
21
|
+
current_event
|
22
|
+
next_event
|
23
|
+
].each do |att|
|
24
|
+
define_method att do
|
25
|
+
Event.new(raw[att]) if raw[att]
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def active?
|
30
|
+
current_event.present?
|
31
|
+
end
|
32
|
+
|
33
|
+
class Event < WCC::Media::Base
|
34
|
+
%w[
|
35
|
+
title
|
36
|
+
description
|
37
|
+
embed_code
|
38
|
+
stream_url
|
39
|
+
starts_at
|
40
|
+
ends_at
|
41
|
+
duration
|
42
|
+
].each do |att|
|
43
|
+
define_method att do
|
44
|
+
raw[att]
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
data/lib/wcc/media/message.rb
CHANGED
@@ -8,6 +8,7 @@ class WCC::Media::Message < WCC::Media::Base
|
|
8
8
|
on_or_after_date
|
9
9
|
on_or_before_date
|
10
10
|
tag_id
|
11
|
+
playlist_id
|
11
12
|
speaker_id
|
12
13
|
scripture_book_id
|
13
14
|
series_id
|
@@ -37,6 +38,10 @@ class WCC::Media::Message < WCC::Media::Base
|
|
37
38
|
(raw['speakers'] || []).map { |val| WCC::Media::Speaker.new(val) }
|
38
39
|
end
|
39
40
|
|
41
|
+
def playlists
|
42
|
+
(raw['playlists'] || []).map { |val| WCC::Media::Playlist.new(val) }
|
43
|
+
end
|
44
|
+
|
40
45
|
def tags
|
41
46
|
(raw['tags'] || []).map { |val| WCC::Media::Tag.new(val) }
|
42
47
|
end
|
data/lib/wcc/media/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wcc-media-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Watermark Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: wcc-api
|
@@ -357,6 +357,7 @@ files:
|
|
357
357
|
- lib/wcc/media/client.rb
|
358
358
|
- lib/wcc/media/client/response.rb
|
359
359
|
- lib/wcc/media/engine.rb
|
360
|
+
- lib/wcc/media/live_stream.rb
|
360
361
|
- lib/wcc/media/message.rb
|
361
362
|
- lib/wcc/media/playlist.rb
|
362
363
|
- lib/wcc/media/rails.rb
|