tune smart clip queries

This commit is contained in:
j 2015-04-25 16:13:42 +02:00
commit 9197591bb6
3 changed files with 77 additions and 53 deletions

View file

@ -133,7 +133,7 @@ pandora.addFolderItem = function(section) {
})),
operator: '|'
};
pandora.api.find({
(isItems ? pandora.api.find : Ox.noop)({
query: {
conditions: [
{key: 'list', value: newList, operator: '=='}
@ -144,9 +144,10 @@ pandora.addFolderItem = function(section) {
sort: [{key: sortKey, operator: ''}],
range: [0, 4]
}, function(result) {
var posterFrames = result.data.items.map(function(item) {
return {item: item.id, position: item.posterFrame};
});
var posterFrames = result
? result.data.items.map(function(item) {
return {item: item.id, position: item.posterFrame};
}) : [];
posterFrames = posterFrames.length == 1
? Ox.repeat([posterFrames[0]], 4)
: posterFrames.length == 2