summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.html36
-rwxr-xr-xlib/rddb.pm3
2 files changed, 37 insertions, 2 deletions
diff --git a/index.html b/index.html
index 5e7fbaf..6110def 100644
--- a/index.html
+++ b/index.html
@@ -42,8 +42,42 @@
$('#alertbox').html('<div class="alert alert-info"><a class="close" data-dismiss="alert" href="#">&times;</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;
}