mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
3.0.5518.5
This commit is contained in:
parent
693848e70b
commit
54c2b1871a
5 changed files with 29 additions and 26 deletions
|
@ -861,6 +861,7 @@ var Dashboard = {
|
||||||
}
|
}
|
||||||
|
|
||||||
ApiClient.openWebSocket();
|
ApiClient.openWebSocket();
|
||||||
|
ApiClient.reportCapabilities(Dashboard.capabilities());
|
||||||
},
|
},
|
||||||
|
|
||||||
processGeneralCommand: function (cmd) {
|
processGeneralCommand: function (cmd) {
|
||||||
|
@ -1273,6 +1274,15 @@ var Dashboard = {
|
||||||
isServerlessPage: function () {
|
isServerlessPage: function () {
|
||||||
var url = getWindowUrl().toLowerCase();
|
var url = getWindowUrl().toLowerCase();
|
||||||
return url.indexOf('connectlogin.html') != -1 || url.indexOf('selectserver.html') != -1;
|
return url.indexOf('connectlogin.html') != -1 || url.indexOf('selectserver.html') != -1;
|
||||||
|
},
|
||||||
|
|
||||||
|
capabilities: function () {
|
||||||
|
return {
|
||||||
|
PlayableMediaTypes: "Audio,Video",
|
||||||
|
|
||||||
|
SupportedCommands: Dashboard.getSupportedRemoteCommands().join(','),
|
||||||
|
SupportsPersistentIdentifier: false
|
||||||
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1329,12 +1339,7 @@ var Dashboard = {
|
||||||
var deviceId = MediaBrowser.generateDeviceId();
|
var deviceId = MediaBrowser.generateDeviceId();
|
||||||
var credentialProvider = new MediaBrowser.CredentialProvider();
|
var credentialProvider = new MediaBrowser.CredentialProvider();
|
||||||
|
|
||||||
var capabilities = {
|
var capabilities = Dashboard.capabilities();
|
||||||
PlayableMediaTypes: "Audio,Video",
|
|
||||||
|
|
||||||
SupportedCommands: Dashboard.getSupportedRemoteCommands().join(','),
|
|
||||||
SupportsPersistentIdentifier: false
|
|
||||||
};
|
|
||||||
|
|
||||||
window.ConnectionManager = new MediaBrowser.ConnectionManager(Logger, credentialProvider, appName, appVersion, deviceName, deviceId, capabilities);
|
window.ConnectionManager = new MediaBrowser.ConnectionManager(Logger, credentialProvider, appName, appVersion, deviceName, deviceId, capabilities);
|
||||||
|
|
||||||
|
@ -1347,7 +1352,7 @@ var Dashboard = {
|
||||||
|
|
||||||
if (!Dashboard.isServerlessPage()) {
|
if (!Dashboard.isServerlessPage()) {
|
||||||
if (Dashboard.serverAddress() && Dashboard.getCurrentUserId() && Dashboard.getAccessToken()) {
|
if (Dashboard.serverAddress() && Dashboard.getCurrentUserId() && Dashboard.getAccessToken()) {
|
||||||
window.ApiClient = new MediaBrowser.ApiClient(Logger, Dashboard.serverAddress(), appName, appVersion, deviceName, deviceId, capabilities);
|
window.ApiClient = new MediaBrowser.ApiClient(Logger, Dashboard.serverAddress(), appName, appVersion, deviceName, deviceId);
|
||||||
|
|
||||||
ApiClient.setCurrentUserId(Dashboard.getCurrentUserId(), Dashboard.getAccessToken());
|
ApiClient.setCurrentUserId(Dashboard.getCurrentUserId(), Dashboard.getAccessToken());
|
||||||
|
|
||||||
|
@ -1362,7 +1367,7 @@ var Dashboard = {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
window.ApiClient = new MediaBrowser.ApiClient(Logger, Dashboard.serverAddress(), appName, appVersion, deviceName, deviceId, capabilities);
|
window.ApiClient = new MediaBrowser.ApiClient(Logger, Dashboard.serverAddress(), appName, appVersion, deviceName, deviceId);
|
||||||
|
|
||||||
ApiClient.setCurrentUserId(Dashboard.getCurrentUserId(), Dashboard.getAccessToken());
|
ApiClient.setCurrentUserId(Dashboard.getCurrentUserId(), Dashboard.getAccessToken());
|
||||||
|
|
||||||
|
|
|
@ -135,6 +135,15 @@
|
||||||
//html += '<h2>' + Globalize.translate('HeaderSettings') + '</h2>';
|
//html += '<h2>' + Globalize.translate('HeaderSettings') + '</h2>';
|
||||||
//html += '<div style="margin:0 -.5em 0 -.25em;">';
|
//html += '<div style="margin:0 -.5em 0 -.25em;">';
|
||||||
|
|
||||||
|
if (result.Options.indexOf('SyncNewContent') != -1) {
|
||||||
|
html += '<br/>';
|
||||||
|
html += '<div>';
|
||||||
|
html += '<label for="chkSyncNewContent">' + Globalize.translate('OptionAutomaticallySyncNewContent') + '</label>';
|
||||||
|
html += '<input type="checkbox" id="chkSyncNewContent" data-mini="true" checked="checked" />';
|
||||||
|
html += '<div class="fieldDescription">' + Globalize.translate('OptionAutomaticallySyncNewContentHelp') + '</div>';
|
||||||
|
html += '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
if (result.Options.indexOf('UnwatchedOnly') != -1) {
|
if (result.Options.indexOf('UnwatchedOnly') != -1) {
|
||||||
html += '<br/>';
|
html += '<br/>';
|
||||||
html += '<div>';
|
html += '<div>';
|
||||||
|
@ -144,15 +153,6 @@
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result.Options.indexOf('SyncNewContent') != -1) {
|
|
||||||
html += '<br/>';
|
|
||||||
html += '<div>';
|
|
||||||
html += '<label for="chkSyncNewContent">' + Globalize.translate('OptionAutomaticallySyncNewContent') + '</label>';
|
|
||||||
html += '<input type="checkbox" id="chkSyncNewContent" data-mini="true" />';
|
|
||||||
html += '<div class="fieldDescription">' + Globalize.translate('OptionAutomaticallySyncNewContentHelp') + '</div>';
|
|
||||||
html += '</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (result.Options.indexOf('ItemLimit') != -1) {
|
if (result.Options.indexOf('ItemLimit') != -1) {
|
||||||
html += '<br/>';
|
html += '<br/>';
|
||||||
html += '<div>';
|
html += '<div>';
|
||||||
|
|
|
@ -141,9 +141,9 @@
|
||||||
|
|
||||||
if (!apiClient) {
|
if (!apiClient) {
|
||||||
|
|
||||||
var url = connectionMode == MediaBrowser.ConnectionMode.Local ? server.LocalAddress : server.RemoteAddress;
|
var url = self.getServerAddress(server, connectionMode);
|
||||||
|
|
||||||
apiClient = new MediaBrowser.ApiClient(logger, url, appName, appVersion, deviceName, deviceId, capabilities);
|
apiClient = new MediaBrowser.ApiClient(logger, url, appName, appVersion, deviceName, deviceId);
|
||||||
|
|
||||||
apiClients.push(apiClient);
|
apiClients.push(apiClient);
|
||||||
|
|
||||||
|
@ -303,7 +303,7 @@
|
||||||
throw new Error("credentials.ConnectUserId cannot be null");
|
throw new Error("credentials.ConnectUserId cannot be null");
|
||||||
}
|
}
|
||||||
|
|
||||||
var url = connectionMode == MediaBrowser.ConnectionMode.Local ? server.LocalAddress : server.RemoteAddress;
|
var url = self.getServerAddress(server, connectionMode);
|
||||||
|
|
||||||
url += "/Connect/Exchange?format=json&ConnectUserId=" + credentials.ConnectUserId;
|
url += "/Connect/Exchange?format=json&ConnectUserId=" + credentials.ConnectUserId;
|
||||||
|
|
||||||
|
@ -331,7 +331,7 @@
|
||||||
|
|
||||||
var deferred = DeferredBuilder.Deferred();
|
var deferred = DeferredBuilder.Deferred();
|
||||||
|
|
||||||
var url = connectionMode == MediaBrowser.ConnectionMode.Local ? server.LocalAddress : server.RemoteAddress;
|
var url = self.getServerAddress(server, connectionMode);
|
||||||
|
|
||||||
AjaxApi.ajax({
|
AjaxApi.ajax({
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
* @param {String} clientName
|
* @param {String} clientName
|
||||||
* @param {String} applicationVersion
|
* @param {String} applicationVersion
|
||||||
*/
|
*/
|
||||||
globalScope.MediaBrowser.ApiClient = function (logger, serverAddress, clientName, applicationVersion, deviceName, deviceId, capabilities) {
|
globalScope.MediaBrowser.ApiClient = function (logger, serverAddress, clientName, applicationVersion, deviceName, deviceId) {
|
||||||
|
|
||||||
if (!serverAddress) {
|
if (!serverAddress) {
|
||||||
throw new Error("Must supply a serverAddress");
|
throw new Error("Must supply a serverAddress");
|
||||||
|
@ -354,8 +354,6 @@
|
||||||
|
|
||||||
self.sendWebSocketMessage("Identity", clientName + "|" + deviceId + "|" + applicationVersion + "|" + deviceName);
|
self.sendWebSocketMessage("Identity", clientName + "|" + deviceId + "|" + applicationVersion + "|" + deviceName);
|
||||||
|
|
||||||
self.reportCapabilities(capabilities);
|
|
||||||
|
|
||||||
Events.trigger(self, 'websocketopen');
|
Events.trigger(self, 'websocketopen');
|
||||||
|
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue