mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
merge from dev
This commit is contained in:
parent
1c8f02ce0f
commit
33b01d778c
911 changed files with 34157 additions and 57125 deletions
|
@ -318,14 +318,16 @@
|
|||
|
||||
if (endpointInfo) {
|
||||
|
||||
var deferred = $.Deferred();
|
||||
deferred.resolveWith(null, [endpointInfo]);
|
||||
return deferred.promise();
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
resolve(endpointInfo);
|
||||
});
|
||||
}
|
||||
|
||||
return ApiClient.getJSON(ApiClient.getUrl('System/Endpoint')).done(function (info) {
|
||||
return ApiClient.getJSON(ApiClient.getUrl('System/Endpoint')).then(function (info) {
|
||||
|
||||
endpointInfo = info;
|
||||
return info;
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -351,10 +353,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 +464,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, [
|
||||
{
|
||||
Items: [item],
|
||||
TotalRecordCount: 1
|
||||
}]);
|
||||
ApiClient.getItem(userId, query.Ids.split(',')).then(function (item) {
|
||||
resolve({
|
||||
Items: [item],
|
||||
TotalRecordCount: 1
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
return deferred.promise();
|
||||
}
|
||||
else {
|
||||
|
||||
|
@ -523,7 +523,7 @@
|
|||
|
||||
self.play = function (options) {
|
||||
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
Dashboard.getCurrentUser().then(function (user) {
|
||||
|
||||
if (options.items) {
|
||||
|
||||
|
@ -535,7 +535,7 @@
|
|||
|
||||
Ids: options.ids.join(',')
|
||||
|
||||
}).done(function (result) {
|
||||
}).then(function (result) {
|
||||
|
||||
options.items = result.Items;
|
||||
self.playWithCommand(options, 'PlayNow');
|
||||
|
@ -550,7 +550,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 +580,7 @@
|
|||
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
ApiClient.getItem(userId, id).done(function (item) {
|
||||
ApiClient.getItem(userId, id).then(function (item) {
|
||||
|
||||
self.playWithCommand({
|
||||
|
||||
|
@ -596,7 +596,7 @@
|
|||
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
ApiClient.getItem(userId, id).done(function (item) {
|
||||
ApiClient.getItem(userId, id).then(function (item) {
|
||||
|
||||
self.playWithCommand({
|
||||
|
||||
|
@ -811,13 +811,11 @@
|
|||
|
||||
self.getPlayerState = function () {
|
||||
|
||||
var deferred = $.Deferred();
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
var result = self.getPlayerStateInternal();
|
||||
|
||||
deferred.resolveWith(null, [result]);
|
||||
|
||||
return deferred.promise();
|
||||
var result = self.getPlayerStateInternal();
|
||||
resolve(result);
|
||||
});
|
||||
};
|
||||
|
||||
self.lastPlayerData = {};
|
||||
|
@ -833,9 +831,9 @@
|
|||
|
||||
self.tryPair = function (target) {
|
||||
|
||||
var deferred = $.Deferred();
|
||||
deferred.resolve();
|
||||
return deferred.promise();
|
||||
return new Promise(function (resolve, reject) {
|
||||
resolve();
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -854,9 +852,6 @@
|
|||
});
|
||||
}
|
||||
|
||||
requirejs(["thirdparty/cast_sender"], function () {
|
||||
|
||||
initializeChromecast();
|
||||
});
|
||||
requirejs(["https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"], initializeChromecast);
|
||||
|
||||
})(window, window.chrome, console);
|
Loading…
Add table
Add a link
Reference in a new issue