program-tv 0.0.7 → 0.0.8

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.
Files changed (3) hide show
  1. data/channels.yml +1 -0
  2. data/lib/program-tv/writer.rb +5 -4
  3. metadata +1 -1
data/channels.yml CHANGED
@@ -15,6 +15,7 @@ novela-tv : novelatv
15
15
  polonia-1 : polonia1
16
16
  polo-tv : polotv
17
17
  polsat : polsat
18
+ polsat-2 : polsat2
18
19
  polsat-biznes : polsatbiznes
19
20
  jim-jam-polsat : polsatjimjam
20
21
  polsat-sport : polsatsport
@@ -14,14 +14,15 @@ module ProgramTV
14
14
  today_schedule = []
15
15
  if File.exist?(xml_path(schedule))
16
16
  File.open(xml_path(schedule), "r+") do |file|
17
- today_schedule = Hash.from_xml(file.read)[:tv][:programme].map do |e|
18
- e[:attributes][:title] = e[:title]
19
- e[:attributes]
17
+ today_schedule = Hash.from_xml(file.read)[:tv][:programme].map do |p|
18
+ p[:attributes][:title] = p[:title]
19
+ p[:attributes]
20
20
  end
21
21
  end
22
22
  end
23
+ new_schedule = (today_schedule + schedule).select{ |p| p[:start] > Time.now.strftime("%Y%m%d000000 %z") }
23
24
  File.open(xml_path(schedule), "w+") do |file|
24
- file.write(build_xml(today_schedule + schedule))
25
+ file.write(build_xml(new_schedule))
25
26
  end
26
27
  end
27
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: program-tv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: