From cb39c5af79db63c721123d9f488eda0d9c4fda63 Mon Sep 17 00:00:00 2001 From: Peter Grassberger Date: Mon, 28 Dec 2015 13:27:07 +0100 Subject: client uses type to filter dropboxes diff --git a/www/js/jingles.js b/www/js/jingles.js index ca52269..1aa2489 100644 --- a/www/js/jingles.js +++ b/www/js/jingles.js @@ -51,13 +51,9 @@ JingleGroupList.prototype.fetch = function() { $('#app-jingles .groups').html(''); var self = this; - rivendell.listDropboxes(function(groupsXml, status, req) { + rivendell.listDropboxes('jingle', function(groupsXml, status, req) { var dbs = $(groupsXml).find("dropboxList").children(); dbs.each(function(index, groupXml) { - if ($('type', groupXml).text() !== 'jingle') { - return true; // continue - } - var jingleGroup = new JingleGroup( $('jingle-title', groupXml).text(), $('group', groupXml).text(), diff --git a/www/js/musicpools.js b/www/js/musicpools.js index cfaec13..2035dfc 100644 --- a/www/js/musicpools.js +++ b/www/js/musicpools.js @@ -46,15 +46,11 @@ var Musicpools = function() { Musicpools.prototype.fetch = function() { var self = this; - rivendell.listDropboxes(function(groupsXml, status, req) { + rivendell.listDropboxes('musicpool', function(groupsXml, status, req) { self.musicpools = []; var dbs = $(groupsXml).find("dropboxList").children(); dbs.each(function(index, groupXml) { - if ($('type', groupXml).text() !== 'musicpool') { - return true; // continue - } - var musicpool = new Musicpool( $('musicpool-title', groupXml).text(), $('musicpool-clock', groupXml).text(), @@ -77,7 +73,7 @@ Musicpools.prototype.updateSelector = function() { $('#musicpool-selector').find('option').remove(); // todo: add from list - this.musicpools.each(function(index, musicpool) { + $(this.musicpools).each(function(index, musicpool) { var name = musicpool.title + ' (' + musicpool.clock + ')'; $('#musicpool-selector').append($('