diff --git a/dashboard-ui/scripts/mediaplayer.js b/dashboard-ui/scripts/mediaplayer.js index 911aabecdb..1886ba67de 100644 --- a/dashboard-ui/scripts/mediaplayer.js +++ b/dashboard-ui/scripts/mediaplayer.js @@ -347,6 +347,12 @@ return false; } + if (mediaSource.Protocol == 'Http') { + if (Dashboard.isConnectMode()) { + return false; + } + } + if (extension == 'm4v' || extension == 'mkv') { return $.browser.chrome != null; } diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index 2cbde794ca..ef4b363f32 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -126,6 +126,21 @@ var Dashboard = { var address = store.getItem('serverAddress'); if (!address && !Dashboard.isConnectMode()) { + + // Try to get the server address from the browser url + // This will preserve protocol, hostname, port and subdirectory + var urlLower = getWindowUrl().toLowerCase(); + var index = urlLower.indexOf('/web'); + if (index == -1) { + index = urlLower.index('/dashboard'); + } + + if (index != -1) { + address = urlLower.substring(0, index); + return address; + } + + // If the above failed, just piece it together manually var loc = window.location; address = loc.protocol + '//' + loc.hostname; diff --git a/dashboard-ui/scripts/sync.js b/dashboard-ui/scripts/sync.js index 4dca35df4d..030aeb584d 100644 --- a/dashboard-ui/scripts/sync.js +++ b/dashboard-ui/scripts/sync.js @@ -110,7 +110,10 @@ }).join(''); html += ''; - + if (!targets.length) { + html += '
' + Globalize.translate('LabelSyncNoTargetsHelp') + '
'; + html += '
' + Globalize.translate('ButtonLearnMore') + '
'; + } html += ''; html += '
'; @@ -187,33 +190,6 @@ }); } - function showUnwatchedFilter(items) { - - return items.filter(function (i) { - - return i.MediaType == "Video" || i.IsFolder || i.Type == "Person" || i.Type == "Genre" || i.Type == "MusicGenre" || i.Type == "GameGenre" || i.Type == "Studio" || i.Type == "MusicArtist"; - - }).length > 0; - } - - function showItemLimit(items) { - - return items.length > 1 || items.filter(function (i) { - - return i.IsFolder || i.Type == "Person" || i.Type == "Genre" || i.Type == "MusicGenre" || i.Type == "GameGenre" || i.Type == "Studio" || i.Type == "MusicArtist"; - - }).length > 0; - } - - function showSyncNew(items) { - - return items.filter(function (i) { - - return i.IsFolder || i.Type == "Person" || i.Type == "Genre" || i.Type == "MusicGenre" || i.Type == "GameGenre" || i.Type == "Studio" || i.Type == "MusicArtist"; - - }).length > 0; - } - function isAvailable(item, user) { return item.SupportsSync; diff --git a/dashboard-ui/thirdparty/apiclient/mediabrowser.apiclient.js b/dashboard-ui/thirdparty/apiclient/mediabrowser.apiclient.js index b7c39c51ba..d4b4512919 100644 --- a/dashboard-ui/thirdparty/apiclient/mediabrowser.apiclient.js +++ b/dashboard-ui/thirdparty/apiclient/mediabrowser.apiclient.js @@ -47,11 +47,6 @@ return serverAddress; }; - self.apiPrefix = function () { - - return ""; - }; - self.serverInfo = function (info) { serverInfo = info || serverInfo; @@ -311,9 +306,7 @@ throw new Error("Url name cannot be empty"); } - var url = serverAddress; - - url += self.apiPrefix() + "/" + name; + var url = serverAddress + "/" + name; if (params) { url += "?" + $.param(params); @@ -341,9 +334,7 @@ self.openWebSocket = function () { - var url = serverAddress + self.apiPrefix(); - - url = url.replace('http', 'ws'); + var url = serverAddress.replace('http', 'ws'); webSocket = new WebSocket(url);