diff --git a/dashboard-ui/thirdparty/apiclient/connectionmanager.js b/dashboard-ui/thirdparty/apiclient/connectionmanager.js index 5bcb318854..77f9e1322c 100644 --- a/dashboard-ui/thirdparty/apiclient/connectionmanager.js +++ b/dashboard-ui/thirdparty/apiclient/connectionmanager.js @@ -2,7 +2,7 @@ window.MediaBrowser = {}; } -MediaBrowser.ConnectionManager = function (store) { +MediaBrowser.ConnectionManager = function ($) { MediaBrowser.ConnectionState = { Unavilable: 0, @@ -67,7 +67,9 @@ MediaBrowser.ConnectionManager = function (store) { dataType: "json", error: function () { - } + }, + + timeout: 5000 }); } @@ -126,7 +128,7 @@ MediaBrowser.ConnectionManager = function (store) { apiClient.serverInfo(server); $(apiClient).on('authenticated', function (e, result) { - onLocalAuthenticated(this, result); + onLocalAuthenticated(this, result, true); }); $(this).trigger('apiclientcreated', [apiClient]); @@ -145,7 +147,7 @@ MediaBrowser.ConnectionManager = function (store) { return apiClient; } - function onLocalAuthenticated(apiClient, result) { + function onLocalAuthenticated(apiClient, result, saveCredentials) { apiClient.getSystemInfo().done(function (systemInfo) { @@ -155,8 +157,14 @@ MediaBrowser.ConnectionManager = function (store) { var credentials = credentialProvider.credentials(); server.DateLastAccessed = new Date().getTime(); - server.UserId = result.User.Id; - server.AccessToken = result.AccessToken; + + if (saveCredentials) { + server.UserId = result.User.Id; + server.AccessToken = result.AccessToken; + } else { + server.UserId = null; + server.AccessToken = null; + } credentials.addOrUpdateServer(credentials.servers, server); credentialProvider.credentials(credentials); @@ -785,4 +793,4 @@ MediaBrowser.ConnectionManager = function (store) { }; }; -}(window.store); \ No newline at end of file +}(jQuery); \ No newline at end of file diff --git a/dashboard-ui/thirdparty/apiclient/mediabrowser.apiclient.js b/dashboard-ui/thirdparty/apiclient/mediabrowser.apiclient.js index 7c59c35575..8282e6d916 100644 --- a/dashboard-ui/thirdparty/apiclient/mediabrowser.apiclient.js +++ b/dashboard-ui/thirdparty/apiclient/mediabrowser.apiclient.js @@ -2,7 +2,7 @@ window.MediaBrowser = {}; } -MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, window, FileReader) { +MediaBrowser.ApiClient = function ($, JSON, WebSocket, setTimeout, devicePixelRatio, FileReader) { /** * Creates a new api client instance @@ -2119,7 +2119,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi function normalizeImageOptions(options) { - var ratio = window.devicePixelRatio || 1; + var ratio = devicePixelRatio || 1; if (ratio) { @@ -3194,7 +3194,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi }; -}(jQuery, navigator, window.JSON, window.WebSocket, setTimeout, window, window.FileReader); +}(jQuery, window.JSON, window.WebSocket, setTimeout, window.devicePixelRatio, window.FileReader); (function (store) {