mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
switch methods to fetch
This commit is contained in:
parent
6acc4bf69d
commit
dd09b038d5
91 changed files with 349 additions and 314 deletions
|
@ -195,6 +195,50 @@
|
|||
return deferred.promise();
|
||||
};
|
||||
|
||||
/**
|
||||
* Wraps around jQuery ajax methods to add additional info to the request.
|
||||
*/
|
||||
self.fetch = function (request, includeAuthorization) {
|
||||
|
||||
if (!request) {
|
||||
throw new Error("Request cannot be null");
|
||||
}
|
||||
|
||||
if (includeAuthorization !== false) {
|
||||
|
||||
request.headers = request.headers || {};
|
||||
self.setRequestHeaders(request.headers);
|
||||
}
|
||||
|
||||
if (self.enableAutomaticNetworking === false || request.type != "GET") {
|
||||
logger.log('Requesting url without automatic networking: ' + request.url);
|
||||
|
||||
return fetch(request.url, {
|
||||
headers: request.headers,
|
||||
method: request.type
|
||||
});
|
||||
}
|
||||
|
||||
var deferred = DeferredBuilder.Deferred();
|
||||
self.ajaxWithFailover(request, deferred, true);
|
||||
return deferred.promise();
|
||||
};
|
||||
|
||||
self.fetchJSON = function (url, includeAuthorization) {
|
||||
|
||||
return self.fetch({
|
||||
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
accept: 'application/json'
|
||||
}
|
||||
|
||||
}, includeAuthorization).then(function(response) {
|
||||
return response.json();
|
||||
});
|
||||
};
|
||||
|
||||
function switchConnectionMode(connectionMode) {
|
||||
|
||||
var currentServerInfo = self.serverInfo();
|
||||
|
@ -569,7 +613,7 @@
|
|||
self.getUrl("Users/" + userId + "/Items/" + itemId) :
|
||||
self.getUrl("Items/" + itemId);
|
||||
|
||||
return self.getJSON(url);
|
||||
return self.fetchJSON(url);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -583,7 +627,7 @@
|
|||
|
||||
var url = self.getUrl("Users/" + userId + "/Items/Root");
|
||||
|
||||
return self.getJSON(url);
|
||||
return self.fetchJSON(url);
|
||||
};
|
||||
|
||||
self.getNotificationSummary = function (userId) {
|
||||
|
@ -1092,7 +1136,7 @@
|
|||
|
||||
var url = self.getUrl("System/Info");
|
||||
|
||||
return self.getJSON(url);
|
||||
return self.fetchJSON(url);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -1102,12 +1146,7 @@
|
|||
|
||||
var url = self.getUrl("System/Info/Public");
|
||||
|
||||
return self.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
dataType: "json"
|
||||
|
||||
}, false);
|
||||
return self.fetchJSON(url, false);
|
||||
};
|
||||
|
||||
self.getInstantMixFromItem = function (itemId, options) {
|
||||
|
@ -1425,7 +1464,7 @@
|
|||
|
||||
var url = self.getUrl("System/Configuration");
|
||||
|
||||
return self.getJSON(url);
|
||||
return self.fetchJSON(url);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -2067,7 +2106,7 @@
|
|||
|
||||
var url = self.getUrl("Genres/" + self.encodeName(name), options);
|
||||
|
||||
return self.getJSON(url);
|
||||
return self.fetchJSON(url);
|
||||
};
|
||||
|
||||
self.getMusicGenre = function (name, userId) {
|
||||
|
@ -2084,7 +2123,7 @@
|
|||
|
||||
var url = self.getUrl("MusicGenres/" + self.encodeName(name), options);
|
||||
|
||||
return self.getJSON(url);
|
||||
return self.fetchJSON(url);
|
||||
};
|
||||
|
||||
self.getGameGenre = function (name, userId) {
|
||||
|
@ -2101,7 +2140,7 @@
|
|||
|
||||
var url = self.getUrl("GameGenres/" + self.encodeName(name), options);
|
||||
|
||||
return self.getJSON(url);
|
||||
return self.fetchJSON(url);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -2121,7 +2160,7 @@
|
|||
|
||||
var url = self.getUrl("Artists/" + self.encodeName(name), options);
|
||||
|
||||
return self.getJSON(url);
|
||||
return self.fetchJSON(url);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -2744,7 +2783,7 @@
|
|||
url = self.getUrl("Items", options);
|
||||
}
|
||||
|
||||
return self.getJSON(url);
|
||||
return self.fetchJSON(url);
|
||||
};
|
||||
|
||||
self.getChannels = function (query) {
|
||||
|
|
|
@ -210,7 +210,7 @@
|
|||
return;
|
||||
}
|
||||
|
||||
apiClient.getPublicSystemInfo().done(function (systemInfo) {
|
||||
apiClient.getPublicSystemInfo().then(function (systemInfo) {
|
||||
|
||||
var credentials = credentialProvider.credentials();
|
||||
existingServer.Id = systemInfo.Id;
|
||||
|
@ -1385,7 +1385,7 @@
|
|||
|
||||
if (!match.DateLastLocalConnection) {
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('System/Endpoint')).done(function (info) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl('System/Endpoint')).then(function (info) {
|
||||
|
||||
if (info.IsInNetwork) {
|
||||
|
||||
|
@ -1395,7 +1395,7 @@
|
|||
deferred.resolveWith(null, [{}]);
|
||||
}
|
||||
|
||||
}).fail(function () {
|
||||
}, function () {
|
||||
|
||||
deferred.resolveWith(null, [{}]);
|
||||
});
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
|
||||
var context = getParameterByName('context');
|
||||
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), id).done(function (item) {
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), id).then(function (item) {
|
||||
|
||||
Dashboard.navigate(LibraryBrowser.getHref(item, context));
|
||||
|
||||
|
@ -98,7 +98,7 @@
|
|||
SortBy: "SortName"
|
||||
};
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).then(function (result) {
|
||||
|
||||
var html = '';
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
if (systemInfo) {
|
||||
deferred.resolveWith(null, [systemInfo]);
|
||||
} else {
|
||||
ApiClient.getPublicSystemInfo().done(function (info) {
|
||||
ApiClient.getPublicSystemInfo().then(function (info) {
|
||||
systemInfo = info;
|
||||
deferred.resolveWith(null, [systemInfo]);
|
||||
});
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
reloadItem(page, item);
|
||||
}
|
||||
else {
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), currentItem.Id).done(function (item) {
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), currentItem.Id).then(function (item) {
|
||||
reloadItem(page, item);
|
||||
});
|
||||
}
|
||||
|
@ -240,7 +240,7 @@
|
|||
|
||||
}).done(function (template) {
|
||||
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), itemId).done(function (item) {
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), itemId).then(function (item) {
|
||||
|
||||
var dlg = PaperDialogHelper.createDialog({
|
||||
theme: options.theme
|
||||
|
|
|
@ -236,7 +236,7 @@
|
|||
|
||||
function showIdentificationForm(page, item) {
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl("Items/" + item.Id + "/ExternalIdInfos")).done(function (idList) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl("Items/" + item.Id + "/ExternalIdInfos")).then(function (idList) {
|
||||
|
||||
var html = '';
|
||||
|
||||
|
@ -288,7 +288,7 @@
|
|||
|
||||
}).done(function (template) {
|
||||
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), itemId).done(function (item) {
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), itemId).then(function (item) {
|
||||
|
||||
currentItem = item;
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
reloadItem(page, item);
|
||||
}
|
||||
else {
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), currentItem.Id).done(function (item) {
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), currentItem.Id).then(function (item) {
|
||||
reloadItem(page, item);
|
||||
});
|
||||
}
|
||||
|
@ -46,7 +46,7 @@
|
|||
|
||||
}).done(function (template) {
|
||||
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), itemId).done(function (item) {
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), itemId).then(function (item) {
|
||||
|
||||
var dlg = document.createElement('paper-dialog');
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
var context = getParameterByName('context');
|
||||
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), id).done(function (item) {
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), id).then(function (item) {
|
||||
|
||||
Dashboard.navigate(LibraryBrowser.getHref(item, context));
|
||||
|
||||
|
@ -106,7 +106,7 @@
|
|||
SortBy: 'SortName'
|
||||
};
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).then(function (result) {
|
||||
|
||||
var html = '';
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@
|
|||
}
|
||||
else {
|
||||
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
Dashboard.getCurrentUser().then(function (user) {
|
||||
|
||||
var lang = user.Configuration.SubtitleLanguagePreference;
|
||||
|
||||
|
@ -291,7 +291,7 @@
|
|||
|
||||
var url = ApiClient.getUrl('Items/' + currentItem.Id + '/RemoteSearch/Subtitles/' + language);
|
||||
|
||||
ApiClient.getJSON(url).done(function (results) {
|
||||
ApiClient.fetchJSON(url).then(function (results) {
|
||||
|
||||
renderSearchResults(page, results);
|
||||
});
|
||||
|
@ -310,7 +310,7 @@
|
|||
}
|
||||
|
||||
if (typeof itemId == 'string') {
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), itemId).done(onGetItem);
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), itemId).then(onGetItem);
|
||||
}
|
||||
else {
|
||||
onGetItem(itemId);
|
||||
|
@ -338,7 +338,7 @@
|
|||
|
||||
}).done(function (template) {
|
||||
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), itemId).done(function (item) {
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), itemId).then(function (item) {
|
||||
|
||||
var dlg = PaperDialogHelper.createDialog();
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
function setCountry(info) {
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('LiveTv/ListingProviders/SchedulesDirect/Countries')).done(function (result) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl('LiveTv/ListingProviders/SchedulesDirect/Countries')).then(function (result) {
|
||||
|
||||
var countryList = [];
|
||||
var i, length;
|
||||
|
@ -72,7 +72,7 @@
|
|||
|
||||
$(page.querySelector('.txtZipCode')).trigger('change');
|
||||
|
||||
}).fail(function () {
|
||||
}, function () {
|
||||
|
||||
Dashboard.alert({
|
||||
message: Globalize.translate('ErrorGettingTvLineups')
|
||||
|
|
28
dashboard-ui/cordova/chromecast.js
vendored
28
dashboard-ui/cordova/chromecast.js
vendored
|
@ -18,17 +18,15 @@
|
|||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
if (query.Ids && query.Ids.split(',').length == 1) {
|
||||
var deferred = DeferredBuilder.Deferred();
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
ApiClient.getItem(userId, query.Ids.split(',')).done(function (item) {
|
||||
deferred.resolveWith(null, [
|
||||
{
|
||||
ApiClient.getItem(userId, query.Ids.split(',')).then(function (item) {
|
||||
resolve({
|
||||
Items: [item],
|
||||
TotalRecordCount: 1
|
||||
}]);
|
||||
});
|
||||
|
||||
return deferred.promise();
|
||||
});
|
||||
});
|
||||
}
|
||||
else {
|
||||
|
||||
|
@ -78,7 +76,7 @@
|
|||
return deferred.promise();
|
||||
}
|
||||
|
||||
return ApiClient.getJSON(ApiClient.getUrl('System/Endpoint')).done(function (info) {
|
||||
return ApiClient.fetchJSON(ApiClient.getUrl('System/Endpoint')).then(function (info) {
|
||||
|
||||
endpointInfo = info;
|
||||
});
|
||||
|
@ -98,10 +96,10 @@
|
|||
supportsAc3: AppSettings.enableChromecastAc3()
|
||||
});
|
||||
|
||||
getEndpointInfo().done(function (endpoint) {
|
||||
getEndpointInfo().then(function (endpoint) {
|
||||
|
||||
if (endpoint.IsInNetwork) {
|
||||
ApiClient.getPublicSystemInfo().done(function (info) {
|
||||
ApiClient.getPublicSystemInfo().then(function (info) {
|
||||
|
||||
message.serverAddress = info.LocalAddress;
|
||||
sendMessageInternal(message);
|
||||
|
@ -119,7 +117,7 @@
|
|||
|
||||
self.play = function (options) {
|
||||
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
Dashboard.getCurrentUser().then(function (user) {
|
||||
|
||||
if (options.items) {
|
||||
|
||||
|
@ -131,7 +129,7 @@
|
|||
|
||||
Ids: options.ids.join(',')
|
||||
|
||||
}).done(function (result) {
|
||||
}).then(function (result) {
|
||||
|
||||
options.items = result.Items;
|
||||
self.playWithCommand(options, 'PlayNow');
|
||||
|
@ -146,7 +144,7 @@
|
|||
self.playWithCommand = function (options, command) {
|
||||
|
||||
if (!options.items) {
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), options.ids[0]).done(function (item) {
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), options.ids[0]).then(function (item) {
|
||||
|
||||
options.items = [item];
|
||||
self.playWithCommand(options, command);
|
||||
|
@ -189,7 +187,7 @@
|
|||
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
ApiClient.getItem(userId, id).done(function (item) {
|
||||
ApiClient.getItem(userId, id).then(function (item) {
|
||||
|
||||
self.playWithCommand({
|
||||
|
||||
|
@ -205,7 +203,7 @@
|
|||
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
ApiClient.getItem(userId, id).done(function (item) {
|
||||
ApiClient.getItem(userId, id).then(function (item) {
|
||||
|
||||
self.playWithCommand({
|
||||
|
||||
|
|
10
dashboard-ui/cordova/generaldevice.js
vendored
10
dashboard-ui/cordova/generaldevice.js
vendored
|
@ -53,7 +53,7 @@
|
|||
|
||||
self.play = function (options) {
|
||||
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
Dashboard.getCurrentUser().then(function (user) {
|
||||
|
||||
if (options.items) {
|
||||
|
||||
|
@ -65,7 +65,7 @@
|
|||
|
||||
Ids: options.ids.join(',')
|
||||
|
||||
}).done(function (result) {
|
||||
}).then(function (result) {
|
||||
|
||||
options.items = result.Items;
|
||||
self.playWithCommand(options, 'PlayNow');
|
||||
|
@ -80,7 +80,7 @@
|
|||
self.playWithCommand = function (options, command) {
|
||||
|
||||
if (!options.items) {
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), options.ids[0]).done(function (item) {
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), options.ids[0]).then(function (item) {
|
||||
|
||||
options.items = [item];
|
||||
self.playWithCommand(options, command);
|
||||
|
@ -220,7 +220,7 @@
|
|||
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
ApiClient.getItem(userId, id).done(function (item) {
|
||||
ApiClient.getItem(userId, id).then(function (item) {
|
||||
|
||||
self.playWithCommand({
|
||||
|
||||
|
@ -236,7 +236,7 @@
|
|||
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
ApiClient.getItem(userId, id).done(function (item) {
|
||||
ApiClient.getItem(userId, id).then(function (item) {
|
||||
|
||||
self.playWithCommand({
|
||||
|
||||
|
|
2
dashboard-ui/cordova/ios/tabbar.js
vendored
2
dashboard-ui/cordova/ios/tabbar.js
vendored
|
@ -154,7 +154,7 @@
|
|||
return;
|
||||
}
|
||||
|
||||
Dashboard.getCurrentUser().done(showUserTabs);
|
||||
Dashboard.getCurrentUser().then(showUserTabs);
|
||||
}
|
||||
|
||||
var isFirstHide = true;
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
|
||||
var form = this;
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
ApiClient.getServerConfiguration().then(function (config) {
|
||||
|
||||
config.EnableDebugLevelLogging = $('#chkDebugLog', form).checked();
|
||||
|
||||
|
@ -80,9 +80,9 @@
|
|||
|
||||
var promise2 = ApiClient.getSystemInfo();
|
||||
|
||||
$.when(promise1, promise2).done(function (response1, response2) {
|
||||
Promise.all([promise1, promise2]).then(function (responses) {
|
||||
|
||||
loadPage(page, response1[0], response2[0]);
|
||||
loadPage(page, responses[0], responses[1]);
|
||||
|
||||
});
|
||||
|
||||
|
|
|
@ -59,10 +59,10 @@
|
|||
includeItemTypes: 'Series',
|
||||
sortBy: 'SortName'
|
||||
|
||||
}).done(function (result) {
|
||||
}).then(function (result) {
|
||||
Dashboard.hideLoadingMsg();
|
||||
showEpisodeCorrectionPopup(page, item, result.Items);
|
||||
}).fail(onApiFailure);
|
||||
}, onApiFailure);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
ParentId: parentId
|
||||
};
|
||||
|
||||
apiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||
apiClient.getItems(Dashboard.getCurrentUserId(), options).then(function (result) {
|
||||
|
||||
var images = result.Items.map(function (i) {
|
||||
return {
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
var channelId = getParameterByName('id');
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl("Channels/" + channelId + "/Features")).done(function (features) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl("Channels/" + channelId + "/Features")).then(function (features) {
|
||||
|
||||
if (features.CanFilter) {
|
||||
|
||||
|
@ -78,14 +78,14 @@
|
|||
|
||||
if (folderId) {
|
||||
|
||||
ApiClient.getItem(query.UserId, folderId).done(function (item) {
|
||||
ApiClient.getItem(query.UserId, folderId).then(function (item) {
|
||||
|
||||
LibraryMenu.setTitle(item.Name);
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
ApiClient.getItem(query.UserId, channelId).done(function (item) {
|
||||
ApiClient.getItem(query.UserId, channelId).then(function (item) {
|
||||
|
||||
LibraryMenu.setTitle(item.Name);
|
||||
});
|
||||
|
@ -93,7 +93,7 @@
|
|||
|
||||
query.folderId = folderId;
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl("Channels/" + channelId + "/Items", query)).done(function (result) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl("Channels/" + channelId + "/Items", query)).then(function (result) {
|
||||
|
||||
// Scroll back up so they can see the results from the beginning
|
||||
window.scrollTo(0, 0);
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
query.UserId = Dashboard.getCurrentUserId();
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl("Channels", query)).done(function (result) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl("Channels", query)).then(function (result) {
|
||||
|
||||
// Scroll back up so they can see the results from the beginning
|
||||
window.scrollTo(0, 0);
|
||||
|
|
|
@ -323,7 +323,7 @@
|
|||
return deferred.promise();
|
||||
}
|
||||
|
||||
return ApiClient.getJSON(ApiClient.getUrl('System/Endpoint')).done(function (info) {
|
||||
return ApiClient.fetchJSON(ApiClient.getUrl('System/Endpoint')).then(function (info) {
|
||||
|
||||
endpointInfo = info;
|
||||
});
|
||||
|
@ -351,10 +351,10 @@
|
|||
supportsAc3: AppSettings.enableChromecastAc3()
|
||||
});
|
||||
|
||||
getEndpointInfo().done(function (endpoint) {
|
||||
getEndpointInfo().then(function (endpoint) {
|
||||
|
||||
if (endpoint.IsInNetwork) {
|
||||
ApiClient.getPublicSystemInfo().done(function (info) {
|
||||
ApiClient.getPublicSystemInfo().then(function (info) {
|
||||
|
||||
message.serverAddress = info.LocalAddress;
|
||||
player.sendMessageInternal(message);
|
||||
|
@ -462,17 +462,15 @@
|
|||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
if (query.Ids && query.Ids.split(',').length == 1) {
|
||||
var deferred = DeferredBuilder.Deferred();
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
ApiClient.getItem(userId, query.Ids.split(',')).done(function (item) {
|
||||
deferred.resolveWith(null, [
|
||||
{
|
||||
ApiClient.getItem(userId, query.Ids.split(',')).then(function (item) {
|
||||
resolve({
|
||||
Items: [item],
|
||||
TotalRecordCount: 1
|
||||
}]);
|
||||
});
|
||||
|
||||
return deferred.promise();
|
||||
});
|
||||
});
|
||||
}
|
||||
else {
|
||||
|
||||
|
@ -523,7 +521,7 @@
|
|||
|
||||
self.play = function (options) {
|
||||
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
Dashboard.getCurrentUser().then(function (user) {
|
||||
|
||||
if (options.items) {
|
||||
|
||||
|
@ -535,7 +533,7 @@
|
|||
|
||||
Ids: options.ids.join(',')
|
||||
|
||||
}).done(function (result) {
|
||||
}).then(function (result) {
|
||||
|
||||
options.items = result.Items;
|
||||
self.playWithCommand(options, 'PlayNow');
|
||||
|
@ -550,7 +548,7 @@
|
|||
self.playWithCommand = function (options, command) {
|
||||
|
||||
if (!options.items) {
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), options.ids[0]).done(function (item) {
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), options.ids[0]).then(function (item) {
|
||||
|
||||
options.items = [item];
|
||||
self.playWithCommand(options, command);
|
||||
|
@ -580,7 +578,7 @@
|
|||
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
ApiClient.getItem(userId, id).done(function (item) {
|
||||
ApiClient.getItem(userId, id).then(function (item) {
|
||||
|
||||
self.playWithCommand({
|
||||
|
||||
|
@ -596,7 +594,7 @@
|
|||
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
ApiClient.getItem(userId, id).done(function (item) {
|
||||
ApiClient.getItem(userId, id).then(function (item) {
|
||||
|
||||
self.playWithCommand({
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
function refreshPageTitle(page) {
|
||||
|
||||
ApiClient.getSystemInfo().done(function (systemInfo) {
|
||||
ApiClient.getSystemInfo().then(function (systemInfo) {
|
||||
|
||||
Dashboard.setPageTitle(systemInfo.ServerName);
|
||||
});
|
||||
|
@ -41,7 +41,7 @@
|
|||
var form = this;
|
||||
var page = $(form).parents('.page');
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
ApiClient.getServerConfiguration().then(function (config) {
|
||||
|
||||
config.ServerName = form.querySelector('#txtServerName').value;
|
||||
config.UICulture = $('#selectLocalizationLanguage', form).val();
|
||||
|
@ -114,11 +114,11 @@
|
|||
|
||||
var promise1 = ApiClient.getServerConfiguration();
|
||||
|
||||
var promise2 = ApiClient.getJSON(ApiClient.getUrl("Localization/Options"));
|
||||
var promise2 = ApiClient.fetchJSON(ApiClient.getUrl("Localization/Options"));
|
||||
|
||||
$.when(promise1, promise2).done(function (response1, response2) {
|
||||
Promise.all([promise1, promise2]).then(function (responses) {
|
||||
|
||||
loadPage(page, response1[0], response2[0]);
|
||||
loadPage(page, responses[0], responses[1]);
|
||||
|
||||
});
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
var form = this;
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
ApiClient.getServerConfiguration().then(function (config) {
|
||||
|
||||
config.HttpServerPortNumber = $('#txtPortNumber', form).val();
|
||||
config.PublicPort = $('#txtPublicPort', form).val();
|
||||
|
@ -46,7 +46,7 @@
|
|||
|
||||
var page = this;
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
ApiClient.getServerConfiguration().then(function (config) {
|
||||
|
||||
loadPage(page, config);
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@
|
|||
|
||||
reloadSystemInfo: function (page) {
|
||||
|
||||
ApiClient.getSystemInfo().done(function (systemInfo) {
|
||||
ApiClient.getSystemInfo().then(function (systemInfo) {
|
||||
|
||||
Dashboard.setPageTitle(systemInfo.ServerName);
|
||||
Dashboard.updateSystemInfo(systemInfo);
|
||||
|
@ -1170,13 +1170,13 @@ $(document).on('pageshow', "#dashboardPage", DashboardPage.onPageShow).on('pageb
|
|||
var minDate = new Date();
|
||||
minDate.setTime(minDate.getTime() - 86400000);
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('System/ActivityLog/Entries', {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl('System/ActivityLog/Entries', {
|
||||
|
||||
startIndex: startIndex,
|
||||
limit: limit,
|
||||
minDate: minDate.toISOString()
|
||||
|
||||
})).done(function (result) {
|
||||
})).then(function (result) {
|
||||
|
||||
elem.setAttribute('data-activitystartindex', startIndex);
|
||||
elem.setAttribute('data-activitylimit', limit);
|
||||
|
|
|
@ -82,11 +82,11 @@
|
|||
function loadData(page) {
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('Devices', {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl('Devices', {
|
||||
|
||||
SupportsPersistentIdentifier: true
|
||||
|
||||
})).done(function (result) {
|
||||
})).then(function (result) {
|
||||
|
||||
load(page, result.Items);
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl("Dlna/ProfileInfos")).done(function (result) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl("Dlna/ProfileInfos")).then(function (result) {
|
||||
|
||||
renderProfiles(page, result);
|
||||
|
||||
|
|
|
@ -13,13 +13,13 @@
|
|||
|
||||
var promise1 = MetadataEditor.getItemPromise();
|
||||
var promise2 = MetadataEditor.getCurrentItemId() ?
|
||||
ApiClient.getJSON(ApiClient.getUrl('Items/' + MetadataEditor.getCurrentItemId() + '/MetadataEditor')) :
|
||||
ApiClient.fetchJSON(ApiClient.getUrl('Items/' + MetadataEditor.getCurrentItemId() + '/MetadataEditor')) :
|
||||
{};
|
||||
|
||||
$.when(promise1, promise2).done(function (response1, response2) {
|
||||
Promise.all([promise1, promise2]).then(function (responses) {
|
||||
|
||||
var item = response1[0];
|
||||
metadataEditorInfo = response2[0];
|
||||
var item = responses[0];
|
||||
metadataEditorInfo = responses[1];
|
||||
|
||||
currentItem = item;
|
||||
|
||||
|
@ -280,7 +280,7 @@
|
|||
$('#fldYear', page).show();
|
||||
}
|
||||
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
Dashboard.getCurrentUser().then(function (user) {
|
||||
|
||||
if (LibraryBrowser.getMoreCommands(item, user).indexOf('identify') != -1) {
|
||||
|
||||
|
@ -895,7 +895,7 @@
|
|||
|
||||
Dashboard.alert(Globalize.translate('MessageItemSaved'));
|
||||
|
||||
MetadataEditor.getItemPromise().done(function (i) {
|
||||
MetadataEditor.getItemPromise().then(function (i) {
|
||||
page.trigger('itemsaved', [i]);
|
||||
bindItemChanged(page);
|
||||
});
|
||||
|
@ -1088,7 +1088,7 @@
|
|||
|
||||
function showMoreMenu(page, elem) {
|
||||
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
Dashboard.getCurrentUser().then(function (user) {
|
||||
|
||||
var moreCommands = LibraryBrowser.getMoreCommands(currentItem, user);
|
||||
|
||||
|
|
|
@ -173,7 +173,7 @@
|
|||
|
||||
function loadMediaFolders(page, scope, openItems, callback) {
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl("Library/MediaFolders")).done(function (result) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl("Library/MediaFolders")).then(function (result) {
|
||||
|
||||
var nodes = result.Items.map(function (n) {
|
||||
|
||||
|
@ -229,7 +229,7 @@
|
|||
query.SortBy = "SortName";
|
||||
}
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) {
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), query).then(function (result) {
|
||||
|
||||
var nodes = result.Items.map(function (n) {
|
||||
|
||||
|
@ -422,7 +422,7 @@
|
|||
|
||||
var page = this;
|
||||
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
Dashboard.getCurrentUser().then(function (user) {
|
||||
|
||||
var id = getCurrentItemId();
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
Dashboard.showLoadingMsg();
|
||||
|
||||
var query = getQuery();
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) {
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), query).then(function (result) {
|
||||
|
||||
// Scroll back up so they can see the results from the beginning
|
||||
window.scrollTo(0, 0);
|
||||
|
|
|
@ -435,7 +435,7 @@
|
|||
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
ApiClient.getItem(userId, itemId).done(function (item) {
|
||||
ApiClient.getItem(userId, itemId).then(function (item) {
|
||||
|
||||
getVideoStreamInfo(item).done(function (streamInfo) {
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
promise = ApiClient.getItems(userId, options);
|
||||
}
|
||||
|
||||
return promise.done(function (result) {
|
||||
return promise.then(function (result) {
|
||||
|
||||
var html = '';
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) {
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), query).then(function (result) {
|
||||
|
||||
// Scroll back up so they can see the results from the beginning
|
||||
window.scrollTo(0, 0);
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
|
||||
};
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).done(function (items) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).then(function (items) {
|
||||
|
||||
$('#recentlyAddedItems', page).html(LibraryBrowser.getPosterViewHtml({
|
||||
items: items,
|
||||
|
@ -44,7 +44,7 @@
|
|||
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
|
||||
};
|
||||
|
||||
ApiClient.getItems(userId, options).done(function (result) {
|
||||
ApiClient.getItems(userId, options).then(function (result) {
|
||||
|
||||
if (result.Items.length) {
|
||||
$('#recentlyPlayedSection', page).show();
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) {
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), query).then(function (result) {
|
||||
|
||||
// Scroll back up so they can see the results from the beginning
|
||||
window.scrollTo(0, 0);
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
|
||||
};
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl("Shows/Upcoming", query)).done(function (result) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl("Shows/Upcoming", query)).then(function (result) {
|
||||
|
||||
var items = result.Items;
|
||||
|
||||
|
|
|
@ -203,7 +203,7 @@
|
|||
|
||||
getDisplayPreferences('home', userId).done(function (result) {
|
||||
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
Dashboard.getCurrentUser().then(function (user) {
|
||||
|
||||
loadSections(tabContent, user, result).done(function () {
|
||||
|
||||
|
|
|
@ -233,7 +233,7 @@
|
|||
|
||||
query = getQuery(query, item);
|
||||
|
||||
getItemsFunction(query, item)(query.StartIndex, query.Limit, query.Fields).done(function (result) {
|
||||
getItemsFunction(query, item)(query.StartIndex, query.Limit, query.Fields).then(function (result) {
|
||||
|
||||
var html = '';
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
getPromise().done(function (item) {
|
||||
getPromise().then(function (item) {
|
||||
|
||||
reloadFromItem(page, item);
|
||||
window.scrollTo(0, 0);
|
||||
|
@ -61,7 +61,7 @@
|
|||
LibraryBrowser.renderParentName(item, $('.parentName', page), context);
|
||||
LibraryMenu.setTitle(item.SeriesName || item.Name);
|
||||
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
Dashboard.getCurrentUser().then(function (user) {
|
||||
|
||||
renderImage(page, item, user);
|
||||
|
||||
|
@ -273,7 +273,7 @@
|
|||
|
||||
currentItem.UserData = userData;
|
||||
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
Dashboard.getCurrentUser().then(function (user) {
|
||||
|
||||
refreshImage(page, currentItem, user);
|
||||
});
|
||||
|
@ -616,7 +616,7 @@
|
|||
|
||||
context = context || '';
|
||||
|
||||
promise.done(function (result) {
|
||||
promise.then(function (result) {
|
||||
|
||||
var foundExisting = false;
|
||||
|
||||
|
@ -683,7 +683,7 @@
|
|||
options.limit = 12;
|
||||
}
|
||||
|
||||
ApiClient.getSimilarItems(item.Id, options).done(function (result) {
|
||||
ApiClient.getSimilarItems(item.Id, options).then(function (result) {
|
||||
|
||||
if (!result.Items.length) {
|
||||
|
||||
|
@ -860,7 +860,7 @@
|
|||
|
||||
promise = promise || ApiClient.getItems(Dashboard.getCurrentUserId(), query);
|
||||
|
||||
promise.done(function (result) {
|
||||
promise.then(function (result) {
|
||||
|
||||
var html = '';
|
||||
|
||||
|
@ -1115,7 +1115,7 @@
|
|||
options.limit = limit;
|
||||
}
|
||||
|
||||
ApiClient.getCriticReviews(item.Id, options).done(function (result) {
|
||||
ApiClient.getCriticReviews(item.Id, options).then(function (result) {
|
||||
|
||||
if (result.TotalRecordCount || item.CriticRatingSummary || item.AwardSummary) {
|
||||
$('#criticReviewsCollapsible', page).show();
|
||||
|
@ -1206,7 +1206,7 @@
|
|||
|
||||
function renderThemeMedia(page, item) {
|
||||
|
||||
ApiClient.getThemeMedia(Dashboard.getCurrentUserId(), item.Id, true).done(function (result) {
|
||||
ApiClient.getThemeMedia(Dashboard.getCurrentUserId(), item.Id, true).then(function (result) {
|
||||
|
||||
var themeSongs = result.ThemeSongsResult.OwnerId == item.Id ?
|
||||
result.ThemeSongsResult.Items :
|
||||
|
@ -1264,7 +1264,7 @@
|
|||
Fields: "DateCreated,SyncInfo",
|
||||
Albums: item.Name
|
||||
|
||||
}).done(function (result) {
|
||||
}).then(function (result) {
|
||||
if (result.Items.length) {
|
||||
|
||||
$('#musicVideosCollapsible', page).show();
|
||||
|
@ -1279,7 +1279,7 @@
|
|||
|
||||
function renderAdditionalParts(page, item, user) {
|
||||
|
||||
ApiClient.getAdditionalVideoParts(user.Id, item.Id).done(function (result) {
|
||||
ApiClient.getAdditionalVideoParts(user.Id, item.Id).then(function (result) {
|
||||
|
||||
if (result.Items.length) {
|
||||
|
||||
|
@ -1612,7 +1612,7 @@
|
|||
|
||||
function renderSpecials(page, item, user, limit) {
|
||||
|
||||
ApiClient.getSpecialFeatures(user.Id, item.Id).done(function (specials) {
|
||||
ApiClient.getSpecialFeatures(user.Id, item.Id).then(function (specials) {
|
||||
|
||||
var specialsContent = page.querySelector('#specialsContent');
|
||||
specialsContent.innerHTML = getVideosHtml(specials, user, limit, "moreSpecials");
|
||||
|
@ -1885,7 +1885,7 @@
|
|||
|
||||
function playTrailer(page) {
|
||||
|
||||
ApiClient.getLocalTrailers(Dashboard.getCurrentUserId(), currentItem.Id).done(function (trailers) {
|
||||
ApiClient.getLocalTrailers(Dashboard.getCurrentUserId(), currentItem.Id).then(function (trailers) {
|
||||
|
||||
MediaController.play({ items: trailers });
|
||||
|
||||
|
@ -1907,7 +1907,7 @@
|
|||
|
||||
if (currentItem.Type == 'Program') {
|
||||
|
||||
ApiClient.getLiveTvChannel(currentItem.ChannelId, Dashboard.getCurrentUserId()).done(function (channel) {
|
||||
ApiClient.getLiveTvChannel(currentItem.ChannelId, Dashboard.getCurrentUserId()).then(function (channel) {
|
||||
|
||||
LibraryBrowser.showPlayMenu(null, channel.Id, channel.Type, false, channel.MediaType, (channel.UserData || {}).PlaybackPositionTicks);
|
||||
});
|
||||
|
@ -1986,7 +1986,7 @@
|
|||
|
||||
var button = this;
|
||||
|
||||
Dashboard.getCurrentUser().done(function(user) {
|
||||
Dashboard.getCurrentUser().then(function (user) {
|
||||
|
||||
LibraryBrowser.showMoreCommands(button, currentItem.Id, LibraryBrowser.getMoreCommands(currentItem, user));
|
||||
});
|
||||
|
@ -2004,7 +2004,7 @@
|
|||
|
||||
$(page).on("click", ".moreScenes", function() {
|
||||
|
||||
Dashboard.getCurrentUser().done(function(user) {
|
||||
Dashboard.getCurrentUser().then(function (user) {
|
||||
renderScenes(page, currentItem, user);
|
||||
});
|
||||
|
||||
|
@ -2014,7 +2014,7 @@
|
|||
|
||||
}).on("click", ".moreSpecials", function() {
|
||||
|
||||
Dashboard.getCurrentUser().done(function(user) {
|
||||
Dashboard.getCurrentUser().then(function (user) {
|
||||
renderSpecials(page, currentItem, user);
|
||||
});
|
||||
|
||||
|
|
|
@ -53,11 +53,11 @@
|
|||
|
||||
var itemsPromise = ApiClient.getItems(userId, query);
|
||||
|
||||
$.when(parentItemPromise, itemsPromise).done(function (r1, r2) {
|
||||
Promise.all([parentItemPromise, itemsPromise]).done(function (responses) {
|
||||
|
||||
var item = r1[0];
|
||||
var item = responses[0];
|
||||
currentItem = item;
|
||||
var result = r2[0];
|
||||
var result = responses[1];
|
||||
|
||||
// Scroll back up so they can see the results from the beginning
|
||||
window.scrollTo(0, 0);
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
EnableImageTypes: "Primary,Backdrop,Thumb"
|
||||
};
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).then(function (result) {
|
||||
|
||||
$('.itemsContainer', page).html(LibraryBrowser.getPosterViewHtml({
|
||||
|
||||
|
|
|
@ -645,7 +645,7 @@
|
|||
return;
|
||||
}
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).done(function (items) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).then(function (items) {
|
||||
|
||||
if (items.length == 1) {
|
||||
|
||||
|
@ -703,10 +703,10 @@
|
|||
var promise1 = ApiClient.getItem(Dashboard.getCurrentUserId(), id);
|
||||
var promise2 = Dashboard.getCurrentUser();
|
||||
|
||||
$.when(promise1, promise2).done(function (response1, response2) {
|
||||
Promise.all([promise1, promise2]).then(function (responses) {
|
||||
|
||||
var item = response1[0];
|
||||
var user = response2[0];
|
||||
var item = responses[0];
|
||||
var user = responses[1];
|
||||
|
||||
var card = elem;
|
||||
|
||||
|
@ -1040,7 +1040,7 @@
|
|||
|
||||
function showMenuForSelectedItems(e) {
|
||||
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
Dashboard.getCurrentUser().then(function (user) {
|
||||
|
||||
var items = [];
|
||||
|
||||
|
@ -1234,7 +1234,7 @@
|
|||
Fields: 'MediaSources,Chapters',
|
||||
Limit: 100
|
||||
|
||||
}).done(function (result) {
|
||||
}).then(function (result) {
|
||||
|
||||
MediaController[method]({
|
||||
items: result.Items
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
if (result) {
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
ApiClient.getServerConfiguration().then(function (config) {
|
||||
|
||||
config.PathSubstitutions.splice(index, 1);
|
||||
|
||||
|
@ -87,7 +87,7 @@
|
|||
$('#txtFrom', page).val('');
|
||||
$('#txtTo', page).val('');
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
ApiClient.getServerConfiguration().then(function (config) {
|
||||
|
||||
loadPage(page, config);
|
||||
|
||||
|
@ -100,7 +100,7 @@
|
|||
var form = this;
|
||||
var page = $(form).parents('.page');
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
ApiClient.getServerConfiguration().then(function (config) {
|
||||
|
||||
addSubstitution(page, config);
|
||||
ApiClient.updateServerConfiguration(config).done(function () {
|
||||
|
@ -123,7 +123,7 @@
|
|||
|
||||
var page = this;
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
ApiClient.getServerConfiguration().then(function (config) {
|
||||
|
||||
loadPage(page, config);
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
var form = this;
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
ApiClient.getServerConfiguration().then(function (config) {
|
||||
|
||||
config.SeasonZeroDisplayName = $('#txtSeasonZeroName', form).val();
|
||||
|
||||
|
@ -45,7 +45,7 @@
|
|||
|
||||
var page = this;
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
ApiClient.getServerConfiguration().then(function (config) {
|
||||
|
||||
loadPage(page, config);
|
||||
|
||||
|
@ -57,7 +57,7 @@
|
|||
|
||||
$('.librarySettingsForm').off('submit', onSubmit).on('submit', onSubmit);
|
||||
|
||||
ApiClient.getSystemInfo().done(function (systemInfo) {
|
||||
ApiClient.getSystemInfo().then(function (systemInfo) {
|
||||
|
||||
if (systemInfo.SupportsLibraryMonitor) {
|
||||
page.querySelector('.fldLibraryMonitor').classList.remove('hide');
|
||||
|
|
|
@ -16,18 +16,18 @@
|
|||
registrationInfo = null;
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('LiveTv/Registration', {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl('LiveTv/Registration', {
|
||||
|
||||
ProgramId: programId,
|
||||
Feature: 'seriesrecordings'
|
||||
})).done(function (result) {
|
||||
})).then(function (result) {
|
||||
|
||||
lastRegId = programId;
|
||||
registrationInfo = result;
|
||||
deferred.resolveWith(null, [registrationInfo]);
|
||||
Dashboard.hideLoadingMsg();
|
||||
|
||||
}).fail(function () {
|
||||
}, function () {
|
||||
|
||||
deferred.resolveWith(null, [
|
||||
{
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
|
||||
apiClient.getJSON(apiClient.getUrl('Branding/Configuration')).done(function (options) {
|
||||
apiClient.fetchJSON(apiClient.getUrl('Branding/Configuration')).then(function (options) {
|
||||
|
||||
$('.disclaimer', page).html(options.LoginDisclaimer || '');
|
||||
});
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
var apiClient = ApiClient;
|
||||
|
||||
apiClient.getJSON(apiClient.getUrl('System/Logs')).done(function (logs) {
|
||||
apiClient.fetchJSON(apiClient.getUrl('System/Logs')).then(function (logs) {
|
||||
|
||||
var html = '';
|
||||
|
||||
|
|
|
@ -38,6 +38,10 @@
|
|||
return;
|
||||
}
|
||||
|
||||
if (self.isFullScreen()) {
|
||||
self.exitFullScreen();
|
||||
}
|
||||
|
||||
fadeOut(document.querySelector('#mediaPlayer'));
|
||||
$('#videoPlayer').removeClass('fullscreenVideo').removeClass('idlePlayer');
|
||||
$('.hiddenOnIdle').removeClass("inactive");
|
||||
|
|
|
@ -628,12 +628,12 @@
|
|||
subtitleStreamIndex = parseInt(subtitleStreamIndex);
|
||||
}
|
||||
|
||||
MediaController.getPlaybackInfo(self.currentItem.Id, deviceProfile, ticks, self.currentMediaSource, audioStreamIndex, subtitleStreamIndex, liveStreamId).done(function (result) {
|
||||
MediaController.getPlaybackInfo(self.currentItem.Id, deviceProfile, ticks, self.currentMediaSource, audioStreamIndex, subtitleStreamIndex, liveStreamId).then(function (result) {
|
||||
|
||||
if (validatePlaybackInfoResult(result)) {
|
||||
|
||||
self.currentMediaSource = result.MediaSources[0];
|
||||
self.createStreamInfo(self.currentItem.MediaType, self.currentItem, self.currentMediaSource, ticks).done(function (streamInfo) {
|
||||
self.createStreamInfo(self.currentItem.MediaType, self.currentItem, self.currentMediaSource, ticks).then(function (streamInfo) {
|
||||
|
||||
if (!streamInfo.url) {
|
||||
MediaController.showPlaybackInfoErrorMessage('NoCompatibleStream');
|
||||
|
@ -753,8 +753,6 @@
|
|||
|
||||
function translateItemsForPlayback(items) {
|
||||
|
||||
var deferred = $.Deferred();
|
||||
|
||||
var firstItem = items[0];
|
||||
var promise;
|
||||
|
||||
|
@ -797,26 +795,31 @@
|
|||
}
|
||||
|
||||
if (promise) {
|
||||
promise.done(function (result) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
deferred.resolveWith(null, [result.Items]);
|
||||
promise.then(function (result) {
|
||||
|
||||
resolve(result.Items);
|
||||
});
|
||||
});
|
||||
} else {
|
||||
deferred.resolveWith(null, [items]);
|
||||
}
|
||||
|
||||
return deferred.promise();
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
resolve(items);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
self.play = function (options) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
Dashboard.getCurrentUser().then(function (user) {
|
||||
|
||||
if (options.items) {
|
||||
|
||||
translateItemsForPlayback(options.items).done(function (items) {
|
||||
translateItemsForPlayback(options.items).then(function (items) {
|
||||
|
||||
self.playWithIntros(items, options, user);
|
||||
});
|
||||
|
@ -827,9 +830,9 @@
|
|||
|
||||
Ids: options.ids.join(',')
|
||||
|
||||
}).done(function (result) {
|
||||
}).then(function (result) {
|
||||
|
||||
translateItemsForPlayback(result.Items).done(function (items) {
|
||||
translateItemsForPlayback(result.Items).then(function (items) {
|
||||
|
||||
self.playWithIntros(items, options, user);
|
||||
});
|
||||
|
@ -859,7 +862,7 @@
|
|||
return;
|
||||
}
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('Users/' + user.Id + '/Items/' + firstItem.Id + '/Intros')).done(function (intros) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl('Users/' + user.Id + '/Items/' + firstItem.Id + '/Intros')).then(function (intros) {
|
||||
|
||||
items = intros.Items.concat(items);
|
||||
self.playInternal(items[0], options.startPositionTicks, function () {
|
||||
|
@ -1077,7 +1080,7 @@
|
|||
|
||||
Dashboard.showModalLoadingMsg();
|
||||
|
||||
ApiClient.detectBitrate().done(function (bitrate) {
|
||||
ApiClient.detectBitrate().then(function (bitrate) {
|
||||
|
||||
Logger.log('Max bitrate auto detected to ' + bitrate);
|
||||
self.lastBitrateDetections[bitrateDetectionKey] = new Date().getTime();
|
||||
|
@ -1101,7 +1104,7 @@
|
|||
Dashboard.showModalLoadingMsg();
|
||||
}
|
||||
|
||||
MediaController.getPlaybackInfo(item.Id, deviceProfile, startPosition).done(function (playbackInfoResult) {
|
||||
MediaController.getPlaybackInfo(item.Id, deviceProfile, startPosition).then(function (playbackInfoResult) {
|
||||
|
||||
if (validatePlaybackInfoResult(playbackInfoResult)) {
|
||||
|
||||
|
@ -1149,7 +1152,7 @@
|
|||
|
||||
if (item.MediaType === "Video") {
|
||||
|
||||
requirejs(['videorenderer'], function () {
|
||||
requirejs(['videorenderer', 'scripts/mediaplayer-video'], function () {
|
||||
self.playVideo(item, self.currentMediaSource, startPosition, callback);
|
||||
});
|
||||
|
||||
|
@ -1209,17 +1212,16 @@
|
|||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
if (query.Ids && query.Ids.split(',').length == 1) {
|
||||
var deferred = DeferredBuilder.Deferred();
|
||||
|
||||
ApiClient.getItem(userId, query.Ids.split(',')).done(function (item) {
|
||||
deferred.resolveWith(null, [
|
||||
{
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
ApiClient.getItem(userId, query.Ids.split(',')).then(function (item) {
|
||||
resolve({
|
||||
Items: [item],
|
||||
TotalRecordCount: 1
|
||||
}]);
|
||||
});
|
||||
|
||||
return deferred.promise();
|
||||
});
|
||||
});
|
||||
}
|
||||
else {
|
||||
|
||||
|
@ -1336,11 +1338,11 @@
|
|||
return;
|
||||
}
|
||||
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
Dashboard.getCurrentUser().then(function (user) {
|
||||
|
||||
if (options.items) {
|
||||
|
||||
translateItemsForPlayback(options.items).done(function (items) {
|
||||
translateItemsForPlayback(options.items).then(function (items) {
|
||||
|
||||
self.queueItems(items);
|
||||
});
|
||||
|
@ -1351,9 +1353,9 @@
|
|||
|
||||
Ids: options.ids.join(',')
|
||||
|
||||
}).done(function (result) {
|
||||
}).then(function (result) {
|
||||
|
||||
translateItemsForPlayback(result.Items).done(function (items) {
|
||||
translateItemsForPlayback(result.Items).then(function (items) {
|
||||
|
||||
self.queueItems(items);
|
||||
});
|
||||
|
@ -1370,7 +1372,7 @@
|
|||
return;
|
||||
}
|
||||
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
Dashboard.getCurrentUser().then(function (user) {
|
||||
|
||||
if (options.items) {
|
||||
|
||||
|
@ -1382,7 +1384,7 @@
|
|||
|
||||
Ids: options.ids.join(',')
|
||||
|
||||
}).done(function (result) {
|
||||
}).then(function (result) {
|
||||
|
||||
options.items = result.Items;
|
||||
|
||||
|
@ -1480,7 +1482,7 @@
|
|||
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
ApiClient.getItem(userId, id).done(function (item) {
|
||||
ApiClient.getItem(userId, id).then(function (item) {
|
||||
|
||||
var query = {
|
||||
UserId: userId,
|
||||
|
@ -1511,7 +1513,7 @@
|
|||
return;
|
||||
}
|
||||
|
||||
self.getItemsForPlayback(query).done(function (result) {
|
||||
self.getItemsForPlayback(query).then(function (result) {
|
||||
|
||||
self.play({ items: result.Items });
|
||||
|
||||
|
@ -1530,7 +1532,7 @@
|
|||
Fields: getItemFields,
|
||||
Limit: itemLimit
|
||||
|
||||
}).done(function (result) {
|
||||
}).then(function (result) {
|
||||
|
||||
self.play({ items: result.Items });
|
||||
|
||||
|
@ -1571,10 +1573,9 @@
|
|||
self.streamInfo = {};
|
||||
}
|
||||
|
||||
if (self.isFullScreen()) {
|
||||
self.exitFullScreen();
|
||||
}
|
||||
if (self.resetEnhancements) {
|
||||
self.resetEnhancements();
|
||||
}
|
||||
};
|
||||
|
||||
self.isPlaying = function () {
|
||||
|
@ -1776,9 +1777,6 @@
|
|||
|
||||
if (item.MediaType == "Video") {
|
||||
|
||||
if (self.isFullScreen()) {
|
||||
self.exitFullScreen();
|
||||
}
|
||||
self.resetEnhancements();
|
||||
}
|
||||
|
||||
|
@ -1922,7 +1920,7 @@
|
|||
|
||||
function playAudioInternal(item, mediaSource, startPositionTicks) {
|
||||
|
||||
self.createStreamInfo('Audio', item, mediaSource, startPositionTicks).done(function (streamInfo) {
|
||||
self.createStreamInfo('Audio', item, mediaSource, startPositionTicks).then(function (streamInfo) {
|
||||
|
||||
self.startTimeTicksOffset = streamInfo.startTimeTicksOffset;
|
||||
|
||||
|
@ -1974,7 +1972,7 @@
|
|||
self.currentMediaRenderer = mediaRenderer;
|
||||
self.currentDurationTicks = self.currentMediaSource.RunTimeTicks;
|
||||
|
||||
mediaRenderer.init().done(function () {
|
||||
mediaRenderer.init().then(function () {
|
||||
|
||||
// Set volume first to avoid an audible change
|
||||
mediaRenderer.volume(initialVolume);
|
||||
|
|
|
@ -101,7 +101,7 @@
|
|||
|
||||
var page = this;
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (configuration) {
|
||||
ApiClient.getServerConfiguration().then(function (configuration) {
|
||||
|
||||
loadAdvancedConfig(page, configuration);
|
||||
|
||||
|
@ -170,7 +170,7 @@
|
|||
|
||||
function saveAdvancedConfig(form) {
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
ApiClient.getServerConfiguration().then(function (config) {
|
||||
|
||||
config.SaveMetadataHidden = $('#chkSaveMetadataHidden', form).checked();
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
ApiClient.getServerConfiguration().then(function (config) {
|
||||
|
||||
config.ImageSavingConvention = $('#selectImageSavingConvention', form).val();
|
||||
|
||||
|
@ -52,7 +52,7 @@
|
|||
var allCultures;
|
||||
var allCountries;
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (result) {
|
||||
ApiClient.getServerConfiguration().then(function (result) {
|
||||
|
||||
config = result;
|
||||
load(page, config, allCultures, allCountries);
|
||||
|
|
|
@ -27,12 +27,12 @@
|
|||
currentType = type;
|
||||
|
||||
var promise1 = ApiClient.getServerConfiguration();
|
||||
var promise2 = ApiClient.getJSON(ApiClient.getUrl("System/Configuration/MetadataPlugins"));
|
||||
var promise2 = ApiClient.fetchJSON(ApiClient.getUrl("System/Configuration/MetadataPlugins"));
|
||||
|
||||
$.when(promise1, promise2).done(function (response1, response2) {
|
||||
Promise.all([promise1, promise2]).then(function (responses) {
|
||||
|
||||
var config = response1[0];
|
||||
var metadataPlugins = response2[0];
|
||||
var config = responses[0];
|
||||
var metadataPlugins = responses[1];
|
||||
|
||||
config = config.MetadataOptions.filter(function (c) {
|
||||
return c.ItemType == type;
|
||||
|
@ -46,7 +46,7 @@
|
|||
|
||||
} else {
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl("System/Configuration/MetadataOptions/Default")).done(function (defaultConfig) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl("System/Configuration/MetadataOptions/Default")).then(function (defaultConfig) {
|
||||
|
||||
|
||||
config = defaultConfig;
|
||||
|
@ -490,7 +490,7 @@
|
|||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
ApiClient.getServerConfiguration().then(function (config) {
|
||||
|
||||
var type = currentType;
|
||||
|
||||
|
@ -505,7 +505,7 @@
|
|||
|
||||
} else {
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl("System/Configuration/MetadataOptions/Default")).done(function (defaultOptions) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl("System/Configuration/MetadataOptions/Default")).then(function (defaultOptions) {
|
||||
|
||||
defaultOptions.ItemType = type;
|
||||
config.MetadataOptions.push(defaultOptions);
|
||||
|
|
|
@ -44,10 +44,10 @@
|
|||
var promise1 = ApiClient.getItems(Dashboard.getCurrentUserId(), query);
|
||||
var promise2 = Dashboard.getCurrentUser();
|
||||
|
||||
$.when(promise1, promise2).done(function (response1, response2) {
|
||||
Promise.all([promise1, promise2]).then(function (responses) {
|
||||
|
||||
var result = response1[0];
|
||||
var user = response2[0];
|
||||
var result = responses[0];
|
||||
var user = responses[1];
|
||||
|
||||
// Scroll back up so they can see the results from the beginning
|
||||
window.scrollTo(0, 0);
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
var query = getQuery();
|
||||
var view = getPageData().view;
|
||||
|
||||
ApiClient.getItems(userId, query).done(function (result) {
|
||||
ApiClient.getItems(userId, query).then(function (result) {
|
||||
|
||||
// Scroll back up so they can see the results from the beginning
|
||||
window.scrollTo(0, 0);
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
|
||||
};
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).done(function (items) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).then(function (items) {
|
||||
|
||||
var view = getView();
|
||||
var html = '';
|
||||
|
@ -93,7 +93,7 @@
|
|||
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
|
||||
};
|
||||
|
||||
ApiClient.getItems(userId, options).done(function (result) {
|
||||
ApiClient.getItems(userId, options).then(function (result) {
|
||||
|
||||
if (result.Items.length) {
|
||||
$('#resumableSection', page).show();
|
||||
|
@ -216,7 +216,7 @@
|
|||
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
|
||||
});
|
||||
|
||||
ApiClient.getJSON(url).done(function (recommendations) {
|
||||
ApiClient.fetchJSON(url).then(function (recommendations) {
|
||||
|
||||
if (!recommendations.length) {
|
||||
|
||||
|
@ -355,7 +355,7 @@
|
|||
|
||||
if (parentId) {
|
||||
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), parentId).done(function (item) {
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), parentId).then(function (item) {
|
||||
|
||||
page.setAttribute('data-title', item.Name);
|
||||
LibraryMenu.setTitle(item.Name);
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
var query = getQuery();
|
||||
query.UserId = Dashboard.getCurrentUserId();
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('Trailers', query)).done(function (result) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl('Trailers', query)).then(function (result) {
|
||||
|
||||
// Scroll back up so they can see the results from the beginning
|
||||
window.scrollTo(0, 0);
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
var query = getQuery();
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) {
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), query).then(function (result) {
|
||||
|
||||
// Scroll back up so they can see the results from the beginning
|
||||
window.scrollTo(0, 0);
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
Dashboard.showLoadingMsg();
|
||||
|
||||
var query = getQuery();
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) {
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), query).then(function (result) {
|
||||
|
||||
// Scroll back up so they can see the results from the beginning
|
||||
window.scrollTo(0, 0);
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
|
||||
};
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).done(function (items) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).then(function (items) {
|
||||
|
||||
var elem = page.querySelector('#recentlyAddedSongs');
|
||||
elem.innerHTML = LibraryBrowser.getPosterViewHtml({
|
||||
|
@ -70,7 +70,7 @@
|
|||
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
|
||||
};
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).then(function (result) {
|
||||
|
||||
var elem;
|
||||
|
||||
|
@ -115,7 +115,7 @@
|
|||
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
|
||||
};
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).then(function (result) {
|
||||
|
||||
var elem;
|
||||
|
||||
|
@ -158,7 +158,7 @@
|
|||
Limit: itemsPerRow()
|
||||
};
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).then(function (result) {
|
||||
|
||||
var elem;
|
||||
|
||||
|
@ -316,7 +316,7 @@
|
|||
|
||||
if (parentId) {
|
||||
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), parentId).done(function (item) {
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), parentId).then(function (item) {
|
||||
|
||||
page.setAttribute('data-title', item.Name);
|
||||
LibraryMenu.setTitle(item.Name);
|
||||
|
|
|
@ -27,7 +27,7 @@ pageIdOn('pageshow', 'myPreferencesMenuPage', function () {
|
|||
page.querySelector('.lnkSync').classList.add('hide');
|
||||
}
|
||||
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
Dashboard.getCurrentUser().then(function (user) {
|
||||
|
||||
page.querySelector('.headerUser').innerHTML = user.Name;
|
||||
|
||||
|
|
|
@ -140,15 +140,15 @@
|
|||
sortBy: "SortName"
|
||||
});
|
||||
var promise2 = ApiClient.getUserViews({}, user.Id);
|
||||
var promise3 = ApiClient.getJSON(ApiClient.getUrl("Users/" + user.Id + "/SpecialViewOptions"));
|
||||
var promise4 = ApiClient.getJSON(ApiClient.getUrl("Users/" + user.Id + "/GroupingOptions"));
|
||||
var promise3 = ApiClient.fetchJSON(ApiClient.getUrl("Users/" + user.Id + "/SpecialViewOptions"));
|
||||
var promise4 = ApiClient.fetchJSON(ApiClient.getUrl("Users/" + user.Id + "/GroupingOptions"));
|
||||
|
||||
$.when(promise1, promise2, promise3, promise4).done(function (r1, r2, r3, r4) {
|
||||
Promise.all([promise1, promise2, promise3, promise4]).then(function (responses) {
|
||||
|
||||
renderViews(page, user, r4[0]);
|
||||
renderLatestItems(page, user, r1[0]);
|
||||
renderViewOrder(page, user, r2[0]);
|
||||
renderViewStyles(page, user, r3[0]);
|
||||
renderViews(page, user, responses[3]);
|
||||
renderLatestItems(page, user, responses[0]);
|
||||
renderViewOrder(page, user, responses[1]);
|
||||
renderViewStyles(page, user, responses[2]);
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl("Notifications/Types")).done(function (list) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl("Notifications/Types")).then(function (list) {
|
||||
|
||||
var html = '';
|
||||
|
||||
|
|
|
@ -452,7 +452,7 @@
|
|||
nowPlayingImageElement.html(imgHtml);
|
||||
|
||||
if (nowPlayingItem.Id) {
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), nowPlayingItem.Id).done(function (item) {
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), nowPlayingItem.Id).then(function (item) {
|
||||
nowPlayingUserData.html(LibraryBrowser.getUserDataIconsHtml(item, false));
|
||||
});
|
||||
} else {
|
||||
|
|
|
@ -604,7 +604,7 @@
|
|||
Backdrops.setBackdropUrl(page, backdropUrl);
|
||||
}
|
||||
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), item.Id).done(function (fullItem) {
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), item.Id).then(function (fullItem) {
|
||||
page.querySelector('.nowPlayingPageUserDataButtons').innerHTML = LibraryBrowser.getUserDataIconsHtml(fullItem, false);
|
||||
});
|
||||
} else {
|
||||
|
@ -686,7 +686,7 @@
|
|||
// EnableImageTypes: "Primary,Backdrop,Banner,Thumb",
|
||||
// Limit: 100
|
||||
|
||||
//}).done(function (result) {
|
||||
//}).then(function (result) {
|
||||
|
||||
// html += LibraryBrowser.getListViewHtml({
|
||||
// items: result.Items,
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
var query = getQuery(tabIndex);
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) {
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), query).then(function (result) {
|
||||
|
||||
// Scroll back up so they can see the results from the beginning
|
||||
window.scrollTo(0, 0);
|
||||
|
@ -117,7 +117,7 @@
|
|||
localQuery.Recursive = true;
|
||||
localQuery.Filters = "IsNotFolder";
|
||||
|
||||
ApiClient.getItems(userId, localQuery).done(function (result) {
|
||||
ApiClient.getItems(userId, localQuery).then(function (result) {
|
||||
|
||||
showSlideshow(page, result.Items, startItemId);
|
||||
});
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
var form = this;
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
ApiClient.getServerConfiguration().then(function (config) {
|
||||
|
||||
config.MinResumePct = $('#txtMinResumePct', form).val();
|
||||
config.MaxResumePct = $('#txtMaxResumePct', form).val();
|
||||
|
@ -37,7 +37,7 @@
|
|||
|
||||
var page = this;
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
ApiClient.getServerConfiguration().then(function (config) {
|
||||
|
||||
loadPage(page, config);
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
|
||||
query.UserId = Dashboard.getCurrentUserId();
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('Playlists/' + item.Id + '/Items', query)).done(function (result) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl('Playlists/' + item.Id + '/Items', query)).then(function (result) {
|
||||
|
||||
// Scroll back up so they can see the results from the beginning
|
||||
window.scrollTo(0, 0);
|
||||
|
|
|
@ -52,10 +52,10 @@
|
|||
var promise1 = ApiClient.getItems(Dashboard.getCurrentUserId(), query);
|
||||
var promise2 = Dashboard.getCurrentUser();
|
||||
|
||||
$.when(promise1, promise2).done(function (response1, response2) {
|
||||
Promise.all([promise1, promise2]).then(function (responses) {
|
||||
|
||||
var result = response1[0];
|
||||
var user = response2[0];
|
||||
var result = responses[0];
|
||||
var user = responses[1];
|
||||
|
||||
// Scroll back up so they can see the results from the beginning
|
||||
window.scrollTo(0, 0);
|
||||
|
|
|
@ -110,7 +110,7 @@
|
|||
|
||||
function renderPlugins(page, plugins, showNoPluginsMessage) {
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl("dashboard/configurationpages") + "?pageType=PluginConfiguration").done(function (configPages) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl("dashboard/configurationpages") + "?pageType=PluginConfiguration").then(function (configPages) {
|
||||
|
||||
populateList(page, plugins, configPages, showNoPluginsMessage);
|
||||
|
||||
|
|
|
@ -131,14 +131,14 @@
|
|||
|
||||
function loadFilters(page, userId, itemQuery, reloadItemsFn) {
|
||||
|
||||
return ApiClient.getJSON(ApiClient.getUrl('Items/Filters', {
|
||||
return ApiClient.fetchJSON(ApiClient.getUrl('Items/Filters', {
|
||||
|
||||
UserId: userId,
|
||||
ParentId: itemQuery.ParentId,
|
||||
IncludeItemTypes: itemQuery.IncludeItemTypes
|
||||
|
||||
|
||||
})).done(function (result) {
|
||||
})).then(function (result) {
|
||||
|
||||
renderFilters(page, result);
|
||||
|
||||
|
|
|
@ -274,7 +274,7 @@
|
|||
var url = "";
|
||||
|
||||
url = ApiClient.getUrl("Reports/Headers", query);
|
||||
ApiClient.getJSON(url).done(function (result) {
|
||||
ApiClient.fetchJSON(url).then(function (result) {
|
||||
var selected = "None";
|
||||
|
||||
$('#selectReportGroup', page).find('option').remove().end();
|
||||
|
@ -438,7 +438,7 @@
|
|||
break;
|
||||
}
|
||||
|
||||
ApiClient.getJSON(url).done(function (result) {
|
||||
ApiClient.fetchJSON(url).then(function (result) {
|
||||
updateFilterControls(page);
|
||||
renderItems(page, result);
|
||||
});
|
||||
|
@ -1029,7 +1029,7 @@
|
|||
|
||||
function loadFilters(page, userId, itemQuery, reloadItemsFn) {
|
||||
|
||||
return ApiClient.getJSON(ApiClient.getUrl('Items/Filters', {
|
||||
return ApiClient.fetchJSON(ApiClient.getUrl('Items/Filters', {
|
||||
|
||||
UserId: userId,
|
||||
ParentId: itemQuery.ParentId,
|
||||
|
@ -1037,7 +1037,7 @@
|
|||
ReportView: itemQuery.ReportView
|
||||
|
||||
|
||||
})).done(function (result) {
|
||||
})).then(function (result) {
|
||||
|
||||
renderFilters(page, result);
|
||||
|
||||
|
@ -1047,13 +1047,13 @@
|
|||
|
||||
function loadColumns(page, userId, itemQuery, reloadItemsFn) {
|
||||
|
||||
return ApiClient.getJSON(ApiClient.getUrl('Reports/Headers', {
|
||||
return ApiClient.fetchJSON(ApiClient.getUrl('Reports/Headers', {
|
||||
|
||||
UserId: userId,
|
||||
IncludeItemTypes: itemQuery.IncludeItemTypes,
|
||||
ReportView: itemQuery.ReportView
|
||||
|
||||
})).done(function (result) {
|
||||
})).then(function (result) {
|
||||
|
||||
renderColumnss(page, result);
|
||||
var filters = "";
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
EnableImages: false
|
||||
};
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).then(function (result) {
|
||||
|
||||
var html = result.Items.map(function (i) {
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@
|
|||
|
||||
var query = getQuery(parentItem);
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) {
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), query).then(function (result) {
|
||||
|
||||
// Scroll back up so they can see the results from the beginning
|
||||
window.scrollTo(0, 0);
|
||||
|
@ -174,7 +174,7 @@
|
|||
var page = this;
|
||||
|
||||
if (getParameterByName('parentid')) {
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), getParameterByName('parentid')).done(function (parent) {
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), getParameterByName('parentid')).then(function (parent) {
|
||||
LibraryMenu.setTitle(parent.Name);
|
||||
|
||||
if (LibraryBrowser.needsRefresh(page)) {
|
||||
|
|
|
@ -191,7 +191,7 @@
|
|||
EnableImageTypes: "Primary,Backdrop,Thumb"
|
||||
};
|
||||
|
||||
return ApiClient.getJSON(ApiClient.getUrl('Users/' + user.Id + '/Items/Latest', options)).done(function (items) {
|
||||
return ApiClient.fetchJSON(ApiClient.getUrl('Users/' + user.Id + '/Items/Latest', options)).then(function (items) {
|
||||
|
||||
var html = '';
|
||||
|
||||
|
@ -239,7 +239,7 @@
|
|||
IncludeItemTypes: "Movie"
|
||||
};
|
||||
|
||||
return ApiClient.getJSON(ApiClient.getUrl('Users/' + user.Id + '/Items/Latest', options)).done(function (items) {
|
||||
return ApiClient.fetchJSON(ApiClient.getUrl('Users/' + user.Id + '/Items/Latest', options)).then(function (items) {
|
||||
|
||||
var html = '';
|
||||
|
||||
|
@ -282,7 +282,7 @@
|
|||
IncludeItemTypes: "Episode"
|
||||
};
|
||||
|
||||
return ApiClient.getJSON(ApiClient.getUrl('Users/' + user.Id + '/Items/Latest', options)).done(function (items) {
|
||||
return ApiClient.fetchJSON(ApiClient.getUrl('Users/' + user.Id + '/Items/Latest', options)).then(function (items) {
|
||||
|
||||
var html = '';
|
||||
|
||||
|
@ -327,7 +327,7 @@
|
|||
UserId: userId
|
||||
};
|
||||
|
||||
return ApiClient.getJSON(ApiClient.getUrl("Channels/Items/Latest", options)).done(function (result) {
|
||||
return ApiClient.fetchJSON(ApiClient.getUrl("Channels/Items/Latest", options)).then(function (result) {
|
||||
|
||||
var html = '';
|
||||
|
||||
|
@ -429,7 +429,7 @@
|
|||
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
|
||||
};
|
||||
|
||||
return ApiClient.getItems(userId, options).done(function (result) {
|
||||
return ApiClient.getItems(userId, options).then(function (result) {
|
||||
|
||||
var html = '';
|
||||
|
||||
|
@ -532,7 +532,7 @@
|
|||
SupportsLatestItems: true
|
||||
});
|
||||
|
||||
return ApiClient.getJSON(ApiClient.getUrl("Channels", options)).done(function (result) {
|
||||
return ApiClient.fetchJSON(ApiClient.getUrl("Channels", options)).then(function (result) {
|
||||
|
||||
var channels = result.Items;
|
||||
|
||||
|
@ -567,7 +567,7 @@
|
|||
ChannelIds: channel.Id
|
||||
};
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl("Channels/Items/Latest", options)).done(function (result) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl("Channels/Items/Latest", options)).then(function (result) {
|
||||
|
||||
var html = '';
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('Social/Shares/Public/' + id + '/Item')).done(function (item) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl('Social/Shares/Public/' + id + '/Item')).then(function (item) {
|
||||
|
||||
reloadFromItem(page, item);
|
||||
});
|
||||
|
|
|
@ -301,7 +301,7 @@ var Dashboard = {
|
|||
|
||||
Dashboard.hideDashboardVersionWarning();
|
||||
|
||||
Dashboard.getCurrentUser().done(function (currentUser) {
|
||||
Dashboard.getCurrentUser().then(function (currentUser) {
|
||||
|
||||
if (currentUser.Policy.IsAdministrator) {
|
||||
Dashboard.showServerRestartWarning(info);
|
||||
|
@ -766,7 +766,7 @@ var Dashboard = {
|
|||
|
||||
if (apiClient && apiClient.accessToken()) {
|
||||
if (AppInfo.enableFooterNotifications) {
|
||||
apiClient.getSystemInfo().done(function (info) {
|
||||
apiClient.getSystemInfo().then(function (info) {
|
||||
|
||||
Dashboard.updateSystemInfo(info);
|
||||
});
|
||||
|
@ -795,7 +795,7 @@ var Dashboard = {
|
|||
reloadPageWhenServerAvailable: function (retryCount) {
|
||||
|
||||
// Don't use apiclient method because we don't want it reporting authentication under the old version
|
||||
ApiClient.getJSON(ApiClient.getUrl("System/Info")).done(function (info) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl("System/Info")).then(function (info) {
|
||||
|
||||
// If this is back to false, the restart completed
|
||||
if (!info.HasPendingRestart) {
|
||||
|
@ -1220,7 +1220,7 @@ var Dashboard = {
|
|||
|
||||
}
|
||||
else if (msg.MessageType === "PackageInstallationCompleted") {
|
||||
Dashboard.getCurrentUser().done(function (currentUser) {
|
||||
Dashboard.getCurrentUser().then(function (currentUser) {
|
||||
|
||||
if (currentUser.Policy.IsAdministrator) {
|
||||
Dashboard.showPackageInstallNotification(msg.Data, "completed");
|
||||
|
@ -1229,7 +1229,7 @@ var Dashboard = {
|
|||
});
|
||||
}
|
||||
else if (msg.MessageType === "PackageInstallationFailed") {
|
||||
Dashboard.getCurrentUser().done(function (currentUser) {
|
||||
Dashboard.getCurrentUser().then(function (currentUser) {
|
||||
|
||||
if (currentUser.Policy.IsAdministrator) {
|
||||
Dashboard.showPackageInstallNotification(msg.Data, "failed");
|
||||
|
@ -1238,7 +1238,7 @@ var Dashboard = {
|
|||
});
|
||||
}
|
||||
else if (msg.MessageType === "PackageInstallationCancelled") {
|
||||
Dashboard.getCurrentUser().done(function (currentUser) {
|
||||
Dashboard.getCurrentUser().then(function (currentUser) {
|
||||
|
||||
if (currentUser.Policy.IsAdministrator) {
|
||||
Dashboard.showPackageInstallNotification(msg.Data, "cancelled");
|
||||
|
@ -1247,7 +1247,7 @@ var Dashboard = {
|
|||
});
|
||||
}
|
||||
else if (msg.MessaapiclientcgeType === "PackageInstalling") {
|
||||
Dashboard.getCurrentUser().done(function (currentUser) {
|
||||
Dashboard.getCurrentUser().then(function (currentUser) {
|
||||
|
||||
if (currentUser.Policy.IsAdministrator) {
|
||||
Dashboard.showPackageInstallNotification(msg.Data, "progress");
|
||||
|
@ -1293,7 +1293,7 @@ var Dashboard = {
|
|||
return;
|
||||
}
|
||||
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), cmd.ItemId).done(function (item) {
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), cmd.ItemId).then(function (item) {
|
||||
|
||||
Dashboard.navigate(LibraryBrowser.getHref(item, null, ''));
|
||||
|
||||
|
@ -1378,7 +1378,7 @@ var Dashboard = {
|
|||
ImageTypes: "Primary",
|
||||
Ids: newItems.join(',')
|
||||
|
||||
}).done(function (result) {
|
||||
}).then(function (result) {
|
||||
|
||||
var items = result.Items;
|
||||
|
||||
|
@ -2381,20 +2381,18 @@ var AppInfo = {};
|
|||
deps.push('scripts/search');
|
||||
deps.push('scripts/librarylist');
|
||||
deps.push('scripts/notifications');
|
||||
deps.push('scripts/alphapicker');
|
||||
|
||||
require(deps, function () {
|
||||
|
||||
$.mobile.initializePage();
|
||||
promiseResolve();
|
||||
require(['scripts/mediaplayer-video']);
|
||||
require(['scripts/thememediaplayer']);
|
||||
});
|
||||
|
||||
if (AppInfo.enableNowPlayingBar) {
|
||||
require(['scripts/nowplayingbar']);
|
||||
}
|
||||
|
||||
require(['scripts/alphapicker']);
|
||||
require(['scripts/thememediaplayer']);
|
||||
}
|
||||
|
||||
function loadImageCache() {
|
||||
|
@ -2551,7 +2549,7 @@ pageClassOn('pageshow', "page", function () {
|
|||
|
||||
Dashboard.ensureToolsMenu(page);
|
||||
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
Dashboard.getCurrentUser().then(function (user) {
|
||||
|
||||
if (!user.Policy.IsAdministrator) {
|
||||
Dashboard.logout();
|
||||
|
|
|
@ -91,7 +91,7 @@
|
|||
|
||||
}, query);
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) {
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), query).then(function (result) {
|
||||
|
||||
if (result.Items.length) {
|
||||
createElements();
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
Dashboard.showLoadingMsg();
|
||||
|
||||
var query = getQuery();
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) {
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), query).then(function (result) {
|
||||
|
||||
// Scroll back up so they can see the results from the beginning
|
||||
window.scrollTo(0, 0);
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
var form = this;
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
ApiClient.getServerConfiguration().then(function (config) {
|
||||
|
||||
config.RemoteClientBitrateLimit = parseInt(parseFloat(($('#txtRemoteClientBitrateLimit', form).val() || '0')) * 1000000);
|
||||
|
||||
|
@ -58,7 +58,7 @@
|
|||
|
||||
var page = this;
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
ApiClient.getServerConfiguration().then(function (config) {
|
||||
|
||||
loadPage(page, config);
|
||||
|
||||
|
|
|
@ -257,7 +257,7 @@ $(document).on('pageshow', "#supporterKeyPage", SupporterKeyPage.onPageShow);
|
|||
|
||||
function loadUserInfo(page) {
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('System/SupporterInfo')).done(function (info) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl('System/SupporterInfo')).then(function (info) {
|
||||
|
||||
if (info.IsActiveSupporter) {
|
||||
$('.supporterContainer', page).addClass('hide');
|
||||
|
|
|
@ -217,7 +217,7 @@
|
|||
Category: options.Category
|
||||
};
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('Sync/Options', dialogOptionsQuery)).done(function (dialogOptions) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl('Sync/Options', dialogOptionsQuery)).then(function (dialogOptions) {
|
||||
|
||||
currentDialogOptions = dialogOptions;
|
||||
|
||||
|
@ -385,7 +385,7 @@
|
|||
return;
|
||||
}
|
||||
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
Dashboard.getCurrentUser().then(function (user) {
|
||||
|
||||
var item = {
|
||||
SupportsSync: true
|
||||
|
|
|
@ -315,7 +315,7 @@
|
|||
|
||||
var options = {};
|
||||
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
Dashboard.getCurrentUser().then(function (user) {
|
||||
|
||||
if ($(page).hasClass('mySyncPage')) {
|
||||
options.UserId = Dashboard.getCurrentUserId();
|
||||
|
@ -325,7 +325,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('Sync/Jobs', options)).done(function (response) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl('Sync/Jobs', options)).then(function (response) {
|
||||
|
||||
loadData(page, response.Items);
|
||||
Dashboard.hideLoadingMsg();
|
||||
|
|
|
@ -288,9 +288,9 @@
|
|||
Dashboard.showLoadingMsg();
|
||||
var id = getParameterByName('id');
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('Sync/Jobs/' + id)).done(function (job) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl('Sync/Jobs/' + id)).then(function (job) {
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('Sync/Options', {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl('Sync/Options', {
|
||||
|
||||
UserId: job.UserId,
|
||||
ItemIds: (job.RequestedItemIds && job.RequestedItemIds.length ? job.RequestedItemIds.join('') : null),
|
||||
|
@ -299,7 +299,7 @@
|
|||
Category: job.Category,
|
||||
TargetId: job.TargetId
|
||||
|
||||
})).done(function (options) {
|
||||
})).then(function (options) {
|
||||
|
||||
_jobOptions = options;
|
||||
renderJob(page, job, options);
|
||||
|
@ -307,12 +307,12 @@
|
|||
});
|
||||
});
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('Sync/JobItems', {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl('Sync/JobItems', {
|
||||
|
||||
JobId: id,
|
||||
AddMetadata: true
|
||||
|
||||
})).done(function (result) {
|
||||
})).then(function (result) {
|
||||
|
||||
renderJobItems(page, result.Items);
|
||||
Dashboard.hideLoadingMsg();
|
||||
|
@ -331,7 +331,7 @@
|
|||
Dashboard.showLoadingMsg();
|
||||
var id = getParameterByName('id');
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('Sync/Jobs/' + id)).done(function (job) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl('Sync/Jobs/' + id)).then(function (job) {
|
||||
|
||||
SyncManager.setJobValues(job, page);
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
|
||||
};
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).done(function (items) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).then(function (items) {
|
||||
|
||||
var view = getView();
|
||||
var html = '';
|
||||
|
|
|
@ -122,7 +122,7 @@
|
|||
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
|
||||
};
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), options).then(function (result) {
|
||||
|
||||
if (result.Items.length) {
|
||||
$('#resumableSection', page).show();
|
||||
|
@ -285,7 +285,7 @@
|
|||
|
||||
if (parentId) {
|
||||
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), parentId).done(function (item) {
|
||||
ApiClient.getItem(Dashboard.getCurrentUserId(), parentId).then(function (item) {
|
||||
|
||||
page.setAttribute('data-title', item.Name);
|
||||
LibraryMenu.setTitle(item.Name);
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
|
||||
var query = getQuery();
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) {
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), query).then(function (result) {
|
||||
|
||||
// Scroll back up so they can see the results from the beginning
|
||||
window.scrollTo(0, 0);
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
query.ParentId = LibraryMenu.getTopParentId();
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl("Shows/Upcoming", query)).done(function (result) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl("Shows/Upcoming", query)).then(function (result) {
|
||||
|
||||
var items = result.Items;
|
||||
|
||||
|
|
|
@ -348,12 +348,12 @@
|
|||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('Connect/Pending')).done(function (pending) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl('Connect/Pending')).then(function (pending) {
|
||||
|
||||
renderPendingGuests(page, pending);
|
||||
});
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl("Library/MediaFolders", { IsHidden: false })).done(function (result) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl("Library/MediaFolders", { IsHidden: false })).then(function (result) {
|
||||
|
||||
renderLibrarySharingList(page, result);
|
||||
});
|
||||
|
@ -363,7 +363,7 @@
|
|||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl("Channels", {})).done(function (channelsResult) {
|
||||
ApiClient.fetchJSON(ApiClient.getUrl("Channels", {})).then(function (channelsResult) {
|
||||
|
||||
var shareExcludes = $(".chkShareFolder:checked", page).get().map(function (i) {
|
||||
|
||||
|
@ -425,7 +425,7 @@
|
|||
|
||||
function showInvitePopup(page) {
|
||||
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
Dashboard.getCurrentUser().then(function (user) {
|
||||
|
||||
if (user.ConnectUserId) {
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
var apiClient = ApiClient;
|
||||
|
||||
apiClient.getJSON(apiClient.getUrl('Startup/Configuration')).done(function (config) {
|
||||
apiClient.fetchJSON(apiClient.getUrl('Startup/Configuration')).then(function (config) {
|
||||
|
||||
var providerId = null;
|
||||
|
||||
|
@ -58,7 +58,7 @@
|
|||
function skip() {
|
||||
var apiClient = ApiClient;
|
||||
|
||||
apiClient.getJSON(apiClient.getUrl('Startup/Info')).done(function (info) {
|
||||
apiClient.fetchJSON(apiClient.getUrl('Startup/Info')).then(function (info) {
|
||||
|
||||
if (info.SupportsRunningAsService) {
|
||||
Dashboard.navigate('wizardservice.html');
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
var apiClient = ApiClient;
|
||||
|
||||
// After saving chapter task, now save server config
|
||||
apiClient.getJSON(apiClient.getUrl('Startup/Configuration')).done(function (config) {
|
||||
apiClient.fetchJSON(apiClient.getUrl('Startup/Configuration')).then(function (config) {
|
||||
|
||||
config.LiveTvTunerType = $('#selectTunerType', page).val();
|
||||
config.LiveTvTunerPath = $('.txtDevicePath', page).val();
|
||||
|
@ -41,7 +41,7 @@
|
|||
|
||||
var apiClient = ApiClient;
|
||||
|
||||
apiClient.getJSON(apiClient.getUrl('Startup/Configuration')).done(function (config) {
|
||||
apiClient.fetchJSON(apiClient.getUrl('Startup/Configuration')).then(function (config) {
|
||||
|
||||
$('#selectTunerType', page).val(config.LiveTvTunerType || 'hdhomerun');
|
||||
page.querySelector('.txtDevicePath').value = config.LiveTvTunerPath || '';
|
||||
|
@ -62,7 +62,7 @@
|
|||
function skip() {
|
||||
var apiClient = ApiClient;
|
||||
|
||||
apiClient.getJSON(apiClient.getUrl('Startup/Info')).done(function (info) {
|
||||
apiClient.fetchJSON(apiClient.getUrl('Startup/Info')).then(function (info) {
|
||||
|
||||
if (info.SupportsRunningAsService) {
|
||||
Dashboard.navigate('wizardservice.html');
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
var apiClient = ApiClient;
|
||||
|
||||
// After saving chapter task, now save server config
|
||||
apiClient.getJSON(apiClient.getUrl('Startup/Configuration')).done(function (config) {
|
||||
apiClient.fetchJSON(apiClient.getUrl('Startup/Configuration')).then(function (config) {
|
||||
|
||||
config.PreferredMetadataLanguage = $('#selectLanguage', page).val();
|
||||
config.MetadataCountryCode = $('#selectCountry', page).val();
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
var apiClient = ApiClient;
|
||||
|
||||
apiClient.getJSON(apiClient.getUrl('Startup/Configuration')).done(function (config) {
|
||||
apiClient.fetchJSON(apiClient.getUrl('Startup/Configuration')).then(function (config) {
|
||||
|
||||
config.UICulture = $('#selectLocalizationLanguage', page).val();
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
|
||||
var apiClient = getApiClient();
|
||||
|
||||
apiClient.getJSON(apiClient.getUrl('Startup/User')).done(function (user) {
|
||||
apiClient.fetchJSON(apiClient.getUrl('Startup/User')).then(function (user) {
|
||||
|
||||
page.querySelector('#txtUsername').value = user.Name;
|
||||
page.querySelector('#txtConnectUserName').value = user.ConnectUserName;
|
||||
|
|
|
@ -178,7 +178,7 @@
|
|||
query.IncludeItemTypes = result.itemType;
|
||||
}
|
||||
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (queryResult) {
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), query).then(function (queryResult) {
|
||||
|
||||
playItems(queryResult.Items, shuffle);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue