Commit 959ec0fd authored by Taddeus Kroes's avatar Taddeus Kroes

Fixed a parsing issue causing programs that were loaded not being shown in the guide

parent 98bfecc6
......@@ -79,6 +79,10 @@ ChannelList = Backbone.Collection.extend(
@findWhere(id: id)?.set(visible: false)
fetchPrograms: (day) ->
# Sometimes a program list is an object (PHP's json_encode() is
# probably given an associative array)
to_array = (o) -> if o.length? then o else _.map(o, ((v, k) -> v))
$('#loading-screen').show()
$.getJSON(
'programs.php'
......@@ -96,7 +100,7 @@ ChannelList = Backbone.Collection.extend(
end: parse_date(p.datum_end)
article_id: p.artikel_id
article_title: p.artikel_titel
) for p in programs
) for p in to_array(programs)
)) if channel?
$('#loading-screen').hide()
)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment