program-tv 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/channels.yml +1 -0
- data/lib/program-tv/writer.rb +5 -4
- metadata +1 -1
data/channels.yml
CHANGED
data/lib/program-tv/writer.rb
CHANGED
@@ -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 |
|
18
|
-
|
19
|
-
|
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(
|
25
|
+
file.write(build_xml(new_schedule))
|
25
26
|
end
|
26
27
|
end
|
27
28
|
end
|