diff --git a/dashboard-ui/scripts/dashboardpage.js b/dashboard-ui/scripts/dashboardpage.js
index fd0d228e0f..372b283e37 100644
--- a/dashboard-ui/scripts/dashboardpage.js
+++ b/dashboard-ui/scripts/dashboardpage.js
@@ -112,7 +112,9 @@
html += '';
html += '
';
- html += connection.UserName || '';
+ if (connection.UserId) {
+ html += '' + connection.UserName + '';
+ }
html += ' | ';
var nowPlayingItem = connection.NowPlayingItem;
@@ -138,7 +140,11 @@
row.removeClass('deadSession');
- $('.username', row).html(session.UserName || '');
+ if (session.UserId) {
+ $('.username', row).html('
' + session.UserName + '').trigger('create');
+ } else {
+ $('.username', row).html('');
+ }
var nowPlayingItem = session.NowPlayingItem;
diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js
index 888514a3ed..0d338ea22d 100644
--- a/dashboard-ui/scripts/site.js
+++ b/dashboard-ui/scripts/site.js
@@ -673,7 +673,7 @@ var Dashboard = {
name: "Media Library",
divider: true,
href: "library.html",
- selected: pageElem.id == "mediaLibraryPage" && !getParameterByName('userId')
+ selected: page.hasClass("mediaLibraryPage")
}, {
name: "Metadata",
href: "metadata.html",
@@ -1248,6 +1248,8 @@ $(function () {
// Close the connection gracefully when possible
if (ApiClient.isWebSocketOpen() && !MediaPlayer.isPlaying()) {
+
+ console.log('Sending close web socket command');
ApiClient.closeWebSocket();
}
});