some initial work on cloud sync

This commit is contained in:
Luke Pulverenti 2015-02-05 00:29:37 -05:00
parent 9c599a3c5c
commit 855e683137
3 changed files with 22 additions and 23 deletions

View file

@ -18,6 +18,24 @@
return 'playlists' + (query.ParentId || '');
}
function getItemsFunction(itemsQuery) {
itemsQuery = $.extend({}, itemsQuery);
return function (index, limit, fields) {
itemsQuery.StartIndex = index;
itemsQuery.Limit = limit;
itemsQuery.Fields = fields;
return ApiClient.getItems(Dashboard.getCurrentUserId(), itemsQuery);
};
}
var _childrenItemsFunction = null;
function reloadItems(page) {
Dashboard.showLoadingMsg();
@ -34,6 +52,8 @@
var user = response2[0];
var item = response3[0];
_childrenItemsFunction = getItemsFunction(query);
currentItem = item;
if (MediaController.canPlay(item)) {
@ -184,21 +204,11 @@
}).on('playallfromhere', function (e, index) {
LibraryBrowser.playAllFromHere({
Recursive: true,
ParentId: query.ParentId
}, index);
LibraryBrowser.playAllFromHere(_childrenItemsFunction, index);
}).on('queueallfromhere', function (e, index) {
LibraryBrowser.queueAllFromHere({
Recursive: true,
ParentId: query.ParentId
}, index);
LibraryBrowser.queueAllFromHere(_childrenItemsFunction, index);
});