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

@ -52,7 +52,6 @@
<a href="http://mediabrowser.tv/download" target="_blank">${PleaseUpdateManually}</a>
</div>
</div>
<div id="updateFail" style="color: #cc0000; display: none;">${ErrorConnectingToMediaBrowserRepository}</div>
<p id="ports"></p>
<div id="pPluginUpdates"></div>

View File

@ -809,8 +809,6 @@
renderHasPendingRestart: function (page, hasPendingRestart) {
$('#updateFail', page).hide();
if (!hasPendingRestart) {
// Only check once every 30 mins
@ -835,10 +833,6 @@
$('#newVersionNumber', page).html(Globalize.translate('VersionXIsAvailableForDownload').replace('{0}', version.versionStr));
}
}).fail(function () {
$('#updateFail', page).show();
});
} else {
@ -908,10 +902,6 @@
elem.html(html).trigger('create');
}).fail(function () {
$('#updateFail', page).show();
});
},

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);
});