poms 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/poms/broadcast.rb +10 -2
- data/lib/poms/version.rb +1 -1
- data/spec/fixtures/poms_broadcast.json +12 -1
- data/spec/lib/poms/broadcast_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa3133cb42150a77d4b5ba7dafe188cee908d1f8
|
4
|
+
data.tar.gz: 7fe2a8a6e7533ef3b7c5867ced37c96202e768d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e95b7a7dd490080822ebd11a78d002ac9b03c1d6b5497a4777baca53f80fae3e4de2d2861fda84740c3b8c4138c4aafd800b99b34fa45682e56dfc3a1f9f765
|
7
|
+
data.tar.gz: 940d70a5e91e3eb6d78cc928213b913a44c9f6a1e1f6a111ae5d293b0ab7a654d6a17e8cfe044a51077292f45a19f6cf2f4c65ba2a8b5cf7d8eaaa05cb3e2081
|
data/Gemfile.lock
CHANGED
data/lib/poms/broadcast.rb
CHANGED
@@ -33,11 +33,19 @@ module Poms
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def available_until
|
36
|
-
return
|
37
|
-
timestamp =
|
36
|
+
return if predictions.blank?
|
37
|
+
timestamp = offline_timestamp(predictions)
|
38
38
|
return Time.at(timestamp / 1000).to_datetime if timestamp
|
39
39
|
end
|
40
40
|
|
41
|
+
private
|
42
|
+
|
43
|
+
def offline_timestamp(predictions, platform = 'INTERNETVOD')
|
44
|
+
timestamps = predictions.map do |p|
|
45
|
+
p.publish_stop if p.platform == platform
|
46
|
+
end.compact
|
47
|
+
timestamps.first unless timestamps.empty?
|
48
|
+
end
|
41
49
|
end
|
42
50
|
|
43
51
|
class Strand < Broadcast
|
data/lib/poms/version.rb
CHANGED
@@ -249,7 +249,18 @@
|
|
249
249
|
"poProgID": "KRO_1614405",
|
250
250
|
"poSeriesID": "KRO_1521173",
|
251
251
|
"predictions": [
|
252
|
-
|
252
|
+
{
|
253
|
+
"state": "REALIZED",
|
254
|
+
"publishStart": 1434172368000,
|
255
|
+
"publishStop": 1435381968000,
|
256
|
+
"platform": "INTERNETVOD"
|
257
|
+
},
|
258
|
+
{
|
259
|
+
"state": "REALIZED",
|
260
|
+
"publishStart": 1434172368000,
|
261
|
+
"publishStop": 1435381968000,
|
262
|
+
"platform": "TVVOD"
|
263
|
+
}
|
253
264
|
],
|
254
265
|
"scheduleEvents": [
|
255
266
|
{
|
@@ -26,7 +26,7 @@ describe Poms::Broadcast do
|
|
26
26
|
end
|
27
27
|
|
28
28
|
it 'correctly sets available until' do
|
29
|
-
expect(poms_broadcast.available_until).to eq(Time.at(
|
29
|
+
expect(poms_broadcast.available_until).to eq(Time.at(1435381968).to_datetime)
|
30
30
|
end
|
31
31
|
|
32
32
|
it 'sets the serie correctly when a broadcast only has a season, no series' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: poms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Kruijsen
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-
|
13
|
+
date: 2015-06-18 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|