diff --git a/lib/Model.js b/lib/Model.js index 01c0a4b..6870ee5 100644 --- a/lib/Model.js +++ b/lib/Model.js @@ -248,17 +248,18 @@ Model.getFilterFromChannel = function(channel) { } if (channel.filter) { - searchFilters.and(); (function AddFilters(filterObject) { var filterKey = Object.keys(filterObject); - searchFilters[filterKey](); + if (filterKey == 'or') + searchFilters.or(); filterObject[filterKey].forEach(function(filters, key) { if (key == 'and' || key == 'or') AddFilters(filterObject[filterKey]); else { + console.log(filters); for(var key2 in filters) { - searchFilters.addFilter(key2, filterObject[filterKey][filters[key2]]); + searchFilters.addFilter(key2, filters[key2]); } } });