diff options
author | Christian Pointner <equinox@helsinki.at> | 2014-09-20 00:46:18 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2014-09-20 00:46:18 (GMT) |
commit | d5c03ec36c38a3a7a3ffa0487a1e5d9feef3cf59 (patch) | |
tree | c8272ef954489177e146d342ff58fc469e7adf47 | |
parent | be89d5f1957d159df4289494c7cab9722e8dc9a5 (diff) |
parsing showlist return values
-rw-r--r-- | index.html | 36 | ||||
-rwxr-xr-x | lib/rddb.pm | 3 |
2 files changed, 37 insertions, 2 deletions
@@ -42,8 +42,42 @@ $('#alertbox').html('<div class="alert alert-info"><a class="close" data-dismiss="alert" href="#">×</a><h4 class="alert-heading">' + heading + '</h4>' + message + '</div>'); } + var weekday = new Array(7); + weekday[0] = "Sonntag"; + weekday[1] = "Montag"; + weekday[2] = "Dienstag"; + weekday[3] = "Mittwoch"; + weekday[4] = "Donnerstag"; + weekday[5] = "Freitag"; + weekday[6] = "Samstag"; + function updateShowsList(data, status, req) { - alert(data); + shows_list = []; + $('#show-selector').find('option').remove(); + var dblist = $(data).find("dropboxList"); + var dbs = dblist.children(); + dbs.each(function() { + type = $(this).find('type').text(); + if(type == 'show') { + var show = { + id: $(this).find('showid').text(), + title: $(this).find('show-title').text(), + dow: $(this).find('show-dayofweek').text(), + rhythm: $(this).find('show-rhythm').text(), + starttime: $(this).find('show-starttime').text(), + length: $(this).find('show-length').text(), + group: $(this).find('group').text(), + normlevel: $(this).find('normalization-level').text(), + trimlevel: $(this).find('autotrim-level').text(), + } + + var name = show.title + ' (' + show.rhythm + ', ' + weekday[show.dow] + ', ' + show.starttime + ', ' + show.length + ' Min.)'; + $('#show-selector').append($('<option>').attr('value',show.id).text(name)); + + shows_list.push(show); + } + } + ) } var shows_list = []; diff --git a/lib/rddb.pm b/lib/rddb.pm index c834dda..b78f4d1 100755 --- a/lib/rddb.pm +++ b/lib/rddb.pm @@ -129,9 +129,10 @@ sub get_dropboxes } $entry->{'SHOWTITLE'} = $title; - if($params =~ /^([01]{4})-([0-9]{2})-([0-9]{2})([0-9]{2})-([0-9]{3})$/) { + if($params =~ /^([01]{4})-([1-7])-([0-9]{2})([0-9]{2})-([0-9]{3})$/) { $entry->{'RHYTHM'} = $1; $entry->{'DOW'} = int $2; + $entry->{'DOW'} = 0 unless $entry->{'DOW'} < 7; $entry->{'STARTTIME'} = "$3:$4"; $entry->{'LENGTH'} = int $5; } |