Selaa lähdekoodia

Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser

Conflicts:
	MediaBrowser.ServerApplication/CorePlugins/MediaBrowser.Api.dll
	MediaBrowser.ServerApplication/CorePlugins/MediaBrowser.ApiInteraction.Javascript.dll
	MediaBrowser.ServerApplication/CorePlugins/MediaBrowser.Server.Sqlite.dll
	MediaBrowser.ServerApplication/CorePlugins/MediaBrowser.Server.WorldWeatherOnline.dll
	MediaBrowser.ServerApplication/CorePlugins/MediaBrowser.WebDashboard.dll
LukePulverenti 12 vuotta sitten
vanhempi
sitoutus
84507736a0

+ 1 - 0
.gitignore

@@ -145,6 +145,7 @@ publish/
 # NuGet Packages Directory
 ## TODO: If you have NuGet Package Restore enabled, uncomment the next line
 packages/
+dlls/
 
 # Windows Azure Build Output
 csx

+ 3 - 0
MediaBrowser.ApiInteraction.Portable/MediaBrowser.ApiInteraction.Portable.csproj

@@ -98,6 +98,9 @@
   <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
   <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
   <Import Project="..\packages\Microsoft.Bcl.Build.1.0.0-rc\tools\Microsoft.Bcl.Build.targets" />
+  <PropertyGroup>
+    <PostBuildEvent>xcopy "$(TargetPath)" "$(SolutionDir)\Nuget\dlls\" /y /d /r /i</PostBuildEvent>
+  </PropertyGroup>
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
        Other similar extension points exist, see Microsoft.Common.targets.
   <Target Name="BeforeBuild">

+ 5 - 5
MediaBrowser.ApiInteraction/ApiClient.cs

@@ -656,7 +656,7 @@ namespace MediaBrowser.ApiInteraction
         /// </summary>
         /// <param name="itemId">The item id.</param>
         /// <param name="userId">The user id.</param>
-        /// <returns>Task{DtoUserItemData}.</returns>
+        /// <returns>Task{UserItemDataDto}.</returns>
         /// <exception cref="System.ArgumentNullException">itemId</exception>
         public Task<UserItemDataDto> ReportPlaybackStartAsync(string itemId, Guid userId)
         {
@@ -686,7 +686,7 @@ namespace MediaBrowser.ApiInteraction
         /// <param name="itemId">The item id.</param>
         /// <param name="userId">The user id.</param>
         /// <param name="positionTicks">The position ticks.</param>
-        /// <returns>Task{DtoUserItemData}.</returns>
+        /// <returns>Task{UserItemDataDto}.</returns>
         /// <exception cref="System.ArgumentNullException">itemId</exception>
         public Task<UserItemDataDto> ReportPlaybackProgressAsync(string itemId, Guid userId, long? positionTicks)
         {
@@ -718,7 +718,7 @@ namespace MediaBrowser.ApiInteraction
         /// <param name="itemId">The item id.</param>
         /// <param name="userId">The user id.</param>
         /// <param name="positionTicks">The position ticks.</param>
-        /// <returns>Task{DtoUserItemData}.</returns>
+        /// <returns>Task{UserItemDataDto}.</returns>
         /// <exception cref="System.ArgumentNullException">itemId</exception>
         public Task<UserItemDataDto> ReportPlaybackStoppedAsync(string itemId, Guid userId, long? positionTicks)
         {
@@ -749,7 +749,7 @@ namespace MediaBrowser.ApiInteraction
         /// </summary>
         /// <param name="itemId">The item id.</param>
         /// <param name="userId">The user id.</param>
-        /// <returns>Task{DtoUserItemData}.</returns>
+        /// <returns>Task{UserItemDataDto}.</returns>
         /// <exception cref="System.ArgumentNullException">itemId</exception>
         public Task ClearUserItemRatingAsync(string itemId, Guid userId)
         {
@@ -774,7 +774,7 @@ namespace MediaBrowser.ApiInteraction
         /// <param name="itemId">The item id.</param>
         /// <param name="userId">The user id.</param>
         /// <param name="likes">if set to <c>true</c> [likes].</param>
-        /// <returns>Task{DtoUserItemData}.</returns>
+        /// <returns>Task{UserItemDataDto}.</returns>
         /// <exception cref="System.ArgumentNullException">itemId</exception>
         public Task<UserItemDataDto> UpdateUserItemRatingAsync(string itemId, Guid userId, bool likes)
         {

+ 3 - 0
MediaBrowser.ApiInteraction/MediaBrowser.ApiInteraction.csproj

@@ -75,6 +75,9 @@
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
+  <PropertyGroup>
+    <PostBuildEvent>xcopy "$(TargetPath)" "$(SolutionDir)\Nuget\dlls\" /y /d /r /i</PostBuildEvent>
+  </PropertyGroup>
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
        Other similar extension points exist, see Microsoft.Common.targets.
   <Target Name="BeforeBuild">

+ 3 - 0
MediaBrowser.Common/MediaBrowser.Common.csproj

@@ -228,6 +228,9 @@
   <ItemGroup />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
+  <PropertyGroup>
+    <PostBuildEvent>xcopy "$(TargetPath)" "$(SolutionDir)\Nuget\dlls\" /y /d /r /i</PostBuildEvent>
+  </PropertyGroup>
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
        Other similar extension points exist, see Microsoft.Common.targets.
   <Target Name="BeforeBuild">

+ 1 - 2
MediaBrowser.Controller/MediaBrowser.Controller.csproj

@@ -227,8 +227,7 @@
   <ItemGroup />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <PropertyGroup>
-    <PostBuildEvent>
-    </PostBuildEvent>
+    <PostBuildEvent>xcopy "$(TargetPath)" "$(SolutionDir)\Nuget\dlls\" /y /d /r /i</PostBuildEvent>
   </PropertyGroup>
   <PropertyGroup>
     <PreBuildEvent>

+ 1 - 1
MediaBrowser.Model/DTO/UserItemDataDto.cs

@@ -4,7 +4,7 @@ using ProtoBuf;
 namespace MediaBrowser.Model.Dto
 {
     /// <summary>
-    /// Class DtoUserItemData
+    /// Class UserItemDataDto
     /// </summary>
     [ProtoContract]
     public class UserItemDataDto : INotifyPropertyChanged

+ 1 - 2
MediaBrowser.Model/MediaBrowser.Model.csproj

@@ -125,8 +125,7 @@
   </ItemGroup>
   <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
   <PropertyGroup>
-    <PostBuildEvent>
-    </PostBuildEvent>
+    <PostBuildEvent>xcopy "$(TargetPath)" "$(SolutionDir)\Nuget\dlls\" /y /d /r /i</PostBuildEvent>
   </PropertyGroup>
   <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 

+ 17 - 2
MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj

@@ -66,7 +66,7 @@
     <ApplicationManifest>app.manifest</ApplicationManifest>
   </PropertyGroup>
   <PropertyGroup>
-    <RunPostBuildEvent>Always</RunPostBuildEvent>
+    <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
   </PropertyGroup>
   <PropertyGroup>
     <ManifestCertificateThumbprint>9633DCDB4A07D3328EFB99299C6DFB1823EBC4BE</ManifestCertificateThumbprint>
@@ -373,7 +373,22 @@
   <ItemGroup />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <PropertyGroup>
-    <PostBuildEvent>xcopy "$(SolutionDir)\packages\System.Data.SQLite.1.0.84.0\content\net40\x86\SQLite.Interop.dll" "$(TargetDir)" /y</PostBuildEvent>
+    <PostBuildEvent>xcopy "$(SolutionDir)\packages\System.Data.SQLite.1.0.84.0\content\net40\x86\SQLite.Interop.dll" "$(TargetDir)" /y
+
+if $(ConfigurationName) == Release (
+xcopy "$(TargetDir)*.dll" "$(SolutionDir)..\Deploy\Server\System" /y
+mkdir "$(SolutionDir)..\Deploy\Server\System\x64"
+xcopy "$(TargetDir)x64" "$(SolutionDir)..\Deploy\Server\System\x64" /y
+
+mkdir "$(SolutionDir)..\Deploy\Server\System\x86"
+xcopy "$(TargetDir)x86" "$(SolutionDir)..\Deploy\Server\System\x86" /y
+
+mkdir "$(SolutionDir)..\Deploy\Server\System\CorePlugins"
+xcopy "$(TargetDir)CorePlugins" "$(SolutionDir)..\Deploy\Server\System\CorePlugins" /y
+
+del 
+"$(SolutionDir)7za" a -tzip "$(SolutionDir)..\Deploy\MBServer.zip" "$(SolutionDir)..\Deploy\Server\*"
+)</PostBuildEvent>
   </PropertyGroup>
   <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 

+ 3 - 0
MediaBrowser.UI.Controls/MediaBrowser.UI.Controls.csproj

@@ -97,6 +97,9 @@
     </Page>
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <PropertyGroup>
+    <PostBuildEvent>xcopy "$(TargetPath)" "$(SolutionDir)\Nuget\dlls\" /y /d /r /i</PostBuildEvent>
+  </PropertyGroup>
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
        Other similar extension points exist, see Microsoft.Common.targets.
   <Target Name="BeforeBuild">

+ 3 - 0
MediaBrowser.UI/MediaBrowser.UI.csproj

@@ -1311,6 +1311,9 @@
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
+  <PropertyGroup>
+    <PostBuildEvent>xcopy "$(TargetPath)" "$(SolutionDir)\Nuget\dlls\" /y /d /r /i</PostBuildEvent>
+  </PropertyGroup>
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
        Other similar extension points exist, see Microsoft.Common.targets.
   <Target Name="BeforeBuild">

BIN
MediaBrowser.WebDashboard/Html/css/images/mblogoblackfull.png


BIN
MediaBrowser.WebDashboard/Html/css/images/mblogoicon.png


BIN
MediaBrowser.WebDashboard/Html/css/images/mblogotextblack.png


BIN
MediaBrowser.WebDashboard/Html/css/images/mblogotextwhite.png


BIN
MediaBrowser.WebDashboard/Html/css/images/mblogowhitefull.png


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 699
MediaBrowser.WebDashboard/Html/css/site.css


+ 1186 - 1186
MediaBrowser.WebDashboard/Html/scripts/site.js

@@ -1,1187 +1,1187 @@
-$.ajaxSetup({
-    crossDomain: true,
-
-    error: function (event, jqxhr, settings, exception) {
-        Dashboard.hideLoadingMsg();
-
-        if (!Dashboard.suppressAjaxErrors) {
-            setTimeout(function () {
-
-
-                var msg = event.getResponseHeader("X-Application-Error-Code") || Dashboard.defaultErrorMessage;
-
-                Dashboard.showError(msg);
-            }, 500);
-        }
-    }
-});
-
-$.support.cors = true;
-
-$(document).one('click', WebNotifications.requestPermission);
-
-var Dashboard = {
-    jQueryMobileInit: function () {
-
-        //$.mobile.defaultPageTransition = 'slide';
-
-        // Page
-        //$.mobile.page.prototype.options.theme = "a";
-        //$.mobile.page.prototype.options.headerTheme = "a";
-        //$.mobile.page.prototype.options.contentTheme = "a";
-        //$.mobile.page.prototype.options.footerTheme = "a";
-
-        //$.mobile.button.prototype.options.theme = "c";
-        $.mobile.listview.prototype.options.dividerTheme = "b";
-
-        $.mobile.popup.prototype.options.theme = "c";
-        //$.mobile.collapsible.prototype.options.contentTheme = "a";
-    },
-
-    getCurrentUser: function () {
-
-        if (!Dashboard.getUserPromise) {
-            Dashboard.getUserPromise = ApiClient.getUser(Dashboard.getCurrentUserId()).fail(Dashboard.logout);
-        }
-
-        return Dashboard.getUserPromise;
-    },
-
-    validateCurrentUser: function () {
-        Dashboard.getUserPromise = null;
-
-        if (Dashboard.getCurrentUserId()) {
-            Dashboard.getCurrentUser();
-        }
-
-        // Re-render the header
-        $('.header').remove();
-        Dashboard.ensureHeader($.mobile.activePage);
-    },
-
-    getCurrentUserId: function () {
-
-        var userId = localStorage.getItem("userId");
-
-        if (!userId) {
-            var autoLoginUserId = getParameterByName('u');
-
-            if (autoLoginUserId) {
-                userId = autoLoginUserId;
-                localStorage.setItem("userId", userId);
-            }
-        }
-
-        return userId;
-    },
-
-    setCurrentUser: function (userId) {
-        localStorage.setItem("userId", userId);
-        Dashboard.getUserPromise = null;
-    },
-
-    logout: function () {
-        localStorage.removeItem("userId");
-        Dashboard.getUserPromise = null;
-        window.location = "login.html";
-    },
-
-    showError: function (message) {
-
-        $.mobile.loading('show', {
-            theme: "e",
-            text: message,
-            textonly: true,
-            textVisible: true
-        });
-
-        setTimeout(function () {
-            $.mobile.loading('hide');
-        }, 2000);
-    },
-
-    alert: function (message) {
-
-        $.mobile.loading('show', {
-            theme: "e",
-            text: message,
-            textonly: true,
-            textVisible: true
-        });
-
-        setTimeout(function () {
-            $.mobile.loading('hide');
-        }, 2000);
-    },
-
-    updateSystemInfo: function (info) {
-
-        var isFirstLoad = !Dashboard.lastSystemInfo;
-
-        Dashboard.lastSystemInfo = info;
-        Dashboard.ensureWebSocket(info);
-
-        if (!Dashboard.initialServerVersion) {
-            Dashboard.initialServerVersion = info.Version;
-        }
-
-        if (info.HasPendingRestart) {
-
-            Dashboard.hideDashboardVersionWarning();
-            Dashboard.showServerRestartWarning();
-
-        } else {
-
-            Dashboard.hideServerRestartWarning();
-
-            if (Dashboard.initialServerVersion != info.Version) {
-
-                Dashboard.showDashboardVersionWarning();
-            }
-        }
-
-        if (isFirstLoad) {
-            Dashboard.showFailedAssemblies(info.FailedPluginAssemblies);
-        }
-
-        Dashboard.showInProgressInstallations(info.InProgressInstallations);
-    },
-
-    showFailedAssemblies: function (failedAssemblies) {
-
-        for (var i = 0, length = failedAssemblies.length; i < length; i++) {
-
-            var assembly = failedAssemblies[i];
-
-            var html = '<img src="css/images/notifications/error.png" class="notificationIcon" />';
-
-            var index = assembly.lastIndexOf('\\');
-
-            if (index != -1) {
-                assembly = assembly.substring(index + 1);
-            }
-
-            html += '<span>';
-            html += assembly + " failed to load.";
-            html += '</span>';
-
-            Dashboard.showFooterNotification({ html: html });
-
-        }
-    },
-
-    showInProgressInstallations: function (installations) {
-
-        installations = installations || [];
-
-        for (var i = 0, length = installations.length; i < length; i++) {
-
-            var installation = installations[i];
-
-            var percent = installation.PercentComplete || 0;
-
-            if (percent < 100) {
-                Dashboard.showPackageInstallNotification(installation, "progress");
-            }
-        }
-
-        if (installations.length) {
-
-            Dashboard.ensureInstallRefreshInterval();
-        } else {
-            Dashboard.stopInstallRefreshInterval();
-        }
-    },
-
-    ensureInstallRefreshInterval: function () {
-
-        if (!Dashboard.installRefreshInterval) {
-
-            if (Dashboard.isWebSocketOpen()) {
-                Dashboard.sendWebSocketMessage("SystemInfoStart", "0,350");
-            }
-            Dashboard.installRefreshInterval = 1;
-        }
-    },
-
-    stopInstallRefreshInterval: function () {
-
-        if (Dashboard.installRefreshInterval) {
-            if (Dashboard.isWebSocketOpen()) {
-                Dashboard.sendWebSocketMessage("SystemInfoStop");
-            }
-            Dashboard.installRefreshInterval = null;
-        }
-    },
-
-    cancelInstallation: function (id) {
-
-        ApiClient.cancelPackageInstallation(id).always(Dashboard.refreshSystemInfoFromServer);
-
-    },
-
-    showServerRestartWarning: function () {
-
-        var html = '<span style="margin-right: 1em;">Please restart Media Browser Server to finish updating.</span>';
-        html += '<button type="button" data-icon="refresh" onclick="Dashboard.restartServer();" data-theme="b" data-inline="true" data-mini="true">Restart Server</button>';
-
-        Dashboard.showFooterNotification({ id: "serverRestartWarning", html: html, forceShow: true, allowHide: false });
-    },
-
-    hideServerRestartWarning: function () {
-
-        $('#serverRestartWarning').remove();
-    },
-
-    showDashboardVersionWarning: function () {
-
-        var html = '<span style="margin-right: 1em;">Please refresh this page to receive new updates from the server.</span>';
-        html += '<button type="button" data-icon="refresh" onclick="Dashboard.reloadPage();" data-theme="b" data-inline="true" data-mini="true">Refresh Page</button>';
-
-        Dashboard.showFooterNotification({ id: "dashboardVersionWarning", html: html, forceShow: true, allowHide: false });
-    },
-
-    reloadPage: function () {
-
-        window.location.href = window.location.href;
-    },
-
-    hideDashboardVersionWarning: function () {
-
-        $('#dashboardVersionWarning').remove();
-    },
-
-    showFooterNotification: function (options) {
-
-        var removeOnHide = !options.id;
-
-        options.id = options.id || "notification" + new Date().getTime() + parseInt(Math.random());
-
-        var parentElem = $('#footerNotifications');
-
-        var elem = $('#' + options.id, parentElem);
-
-        if (!elem.length) {
-            elem = $('<p id="' + options.id + '" class="footerNotification"></p>').appendTo(parentElem);
-        }
-
-        var onclick = removeOnHide ? "$(\"#" + options.id + "\").remove();" : "$(\"#" + options.id + "\").hide();";
-
-        if (options.allowHide !== false) {
-            options.html += "<span style='margin-left: 1em;'><button type='button' onclick='" + onclick + "' data-icon='delete' data-iconpos='notext' data-mini='true' data-inline='true' data-theme='a'>Hide</button></span>";
-        }
-
-        if (options.forceShow) {
-            elem.show();
-        }
-
-        elem.html(options.html).trigger('create');
-
-        if (options.timeout) {
-
-            setTimeout(function () {
-
-                if (removeOnHide) {
-                    elem.remove();
-                } else {
-                    elem.hide();
-                }
-
-            }, options.timeout);
-        }
-    },
-
-    getConfigurationPageUrl: function (name) {
-        return "ConfigurationPage?name=" + encodeURIComponent(name);
-    },
-
-    navigate: function (url, preserveQueryString) {
-
-        var queryString = window.location.search;
-        if (preserveQueryString && queryString) {
-            url += queryString;
-        }
-        $.mobile.changePage(url);
-    },
-
-    showLoadingMsg: function () {
-        $.mobile.showPageLoadingMsg();
-    },
-
-    hideLoadingMsg: function () {
-        $.mobile.hidePageLoadingMsg();
-    },
-
-    processPluginConfigurationUpdateResult: function () {
-
-        Dashboard.hideLoadingMsg();
-
-        Dashboard.alert("Settings saved.");
-    },
-
-    defaultErrorMessage: "There was an error processing the request.",
-
-    processServerConfigurationUpdateResult: function (result) {
-
-        Dashboard.hideLoadingMsg();
-
-        Dashboard.alert("Settings saved.");
-    },
-
-    confirm: function (message, title, callback) {
-
-        $('#confirmFlyout').popup("close").remove();
-
-        var html = '<div data-role="popup" id="confirmFlyout" style="max-width:500px;" class="ui-corner-all">';
-
-        html += '<div class="ui-corner-top ui-bar-a" style="text-align:center;">';
-        html += '<h3>' + title + '</h3>';
-        html += '</div>';
-
-        html += '<div data-role="content" class="ui-corner-bottom ui-content">';
-
-        html += '<div style="padding: 1em .25em;margin: 0;">';
-        html += message;
-        html += '</div>';
-
-        html += '<p><button type="button" data-icon="ok" onclick="$(\'#confirmFlyout\')[0].confirm=true;$(\'#confirmFlyout\').popup(\'close\');" data-theme="b">Ok</button></p>';
-        html += '<p><button type="button" data-icon="delete" onclick="$(\'#confirmFlyout\').popup(\'close\');" data-theme="a">Cancel</button></p>';
-        html += '</div>';
-
-        html += '</div>';
-
-        $(document.body).append(html);
-
-        $('#confirmFlyout').popup().trigger('create').popup("open").on("popupafterclose", function () {
-
-            if (callback) {
-                callback(this.confirm == true);
-            }
-
-            $(this).off("popupafterclose").remove();
-        });
-    },
-
-    refreshSystemInfoFromServer: function () {
-        ApiClient.getSystemInfo().done(function (info) {
-
-            Dashboard.updateSystemInfo(info);
-        });
-    },
-
-    restartServer: function () {
-
-        Dashboard.suppressAjaxErrors = true;
-        Dashboard.showLoadingMsg();
-
-        ApiClient.performPendingRestart().done(function () {
-
-            setTimeout(function () {
-                Dashboard.reloadPageWhenServerAvailable();
-            }, 500);
-
-        }).fail(function () {
-            Dashboard.suppressAjaxErrors = false;
-        });
-    },
-
-    reloadPageWhenServerAvailable: function (retryCount) {
-
-        ApiClient.getSystemInfo().done(function () {
-            Dashboard.reloadPage();
-
-        }).fail(function () {
-            setTimeout(function () {
-
-                retryCount = retryCount || 0;
-                retryCount++;
-
-                if (retryCount < 10) {
-                    Dashboard.reloadPageWhenServerAvailable(retryCount);
-                } else {
-                    Dashboard.suppressAjaxErrors = false;
-                }
-            }, 500);
-        });
-    },
-
-    getPosterViewHtml: function (options) {
-
-        var html = "";
-
-        for (var i = 0, length = options.items.length; i < length; i++) {
-            var item = options.items[i];
-
-            var hasPrimaryImage = item.ImageTags && item.ImageTags.Primary;
-
-            var href = item.IsFolder ? "#" : "itemDetails.html?id=" + item.Id;
-
-            html += "<div class='posterViewItem'><a href='" + href + "'>";
-
-            if (options.preferBackdrop && item.BackdropImageTags && item.BackdropImageTags.length) {
-                html += "<img src='" + ApiClient.getImageUrl(item.Id, {
-                    type: "Backdrop",
-                    height: 198,
-                    width: 352,
-                    tag: item.BackdropImageTags[0]
-                }) + "' />";
-            } else if (hasPrimaryImage) {
-                html += "<img src='" + ApiClient.getImageUrl(item.Id, {
-                    type: "Primary",
-                    height: 300,
-                    tag: item.ImageTags.Primary
-                }) + "' />";
-            }
-            else if (item.BackdropImageTags && item.BackdropImageTags.length) {
-                html += "<img src='" + ApiClient.getImageUrl(item.Id, {
-                    type: "Backdrop",
-                    height: 198,
-                    width: 352,
-                    tag: item.BackdropImageTags[0]
-                }) + "' />";
-            } else {
-                html += "<img style='background:" + Dashboard.getRandomMetroColor() + ";' src='css/images/defaultCollectionImage.png' />";
-            }
-
-            if (options.showTitle || !hasPrimaryImage || (item.Type !== 'Movie' && item.Type !== 'Series' && item.Type !== 'Season')) {
-                html += "<div class='posterViewItemText'>";
-                html += "<div>" + item.Name + "</div>";
-                html += "</div>"
-            }
-
-            html += "</a></div>";
-        }
-
-        return html;
-    },
-
-    showUserFlyout: function () {
-
-        Dashboard.getCurrentUser().done(function (user) {
-
-            var html = '<div data-role="popup" id="userFlyout" style="max-width:400px;margin-top:50px;margin-right:20px;" class="ui-corner-all" data-position-to=".btnCurrentUser:visible">';
-
-            html += '<a href="#" data-rel="back" data-role="button" data-theme="a" data-icon="delete" data-iconpos="notext" class="ui-btn-right">Close</a>';
-
-            html += '<div class="ui-corner-top ui-bar-a" style="text-align:center;">';
-            html += '<h3>' + user.Name + '</h3>';
-            html += '</div>';
-
-            html += '<div data-role="content" class="ui-corner-bottom ui-content">';
-
-            html += '<p style="text-align:center;">';
-
-            var imageUrl = user.PrimaryImageTag ? ApiClient.getUserImageUrl(user.Id, {
-
-                height: 400,
-                tag: user.PrimaryImageTag,
-                type: "Primary"
-
-            }) : "css/images/userFlyoutDefault.png";
-
-            html += '<img style="max-height:125px;max-width:200px;" src="' + imageUrl + '" />';
-            html += '</p>';
-
-            html += '<p><button type="button" onclick="Dashboard.navigate(\'editUser.html?userId=' + user.Id + '\');" data-icon="user">View Profile</button></p>';
-            html += '<p><button type="button" onclick="Dashboard.logout();" data-icon="lock">Sign Out</button></p>';
-            html += '</div>';
-
-            html += '</div>';
-
-            $(document.body).append(html);
-
-            $('#userFlyout').popup().trigger('create').popup("open").on("popupafterclose", function () {
-
-                $(this).off("popupafterclose").remove();
-            });
-        });
-    },
-
-    selectDirectory: function (options) {
-
-        options = options || {};
-
-        options.header = options.header || "Select Media Path";
-
-        var html = '<div data-role="popup" id="popupDirectoryPicker" class="ui-corner-all popup">';
-
-        html += '<div class="ui-corner-top ui-bar-a" style="text-align: center; padding: 0 20px;">';
-        html += '<h3>' + options.header + '</h3>';
-        html += '</div>';
-
-        html += '<div data-role="content" class="ui-corner-bottom ui-content">';
-        html += '<form>';
-        html += '<p>Browse to or enter the folder containing the media. Network paths (UNC) are recommended for optimal playback performance.</p>';
-
-        html += '<div data-role="fieldcontain" style="margin:0;">';
-        html += '<label for="txtDirectoryPickerPath">Current Folder:</label>';
-        html += '<input id="txtDirectoryPickerPath" name="txtDirectoryPickerPath" type="text" onchange="Dashboard.refreshDirectoryBrowser(this.value);" required="required" style="font-weight:bold;" />';
-        html += '</div>';
-
-        html += '<div style="height: 300px; overflow-y: auto;">';
-        html += '<ul id="ulDirectoryPickerList" data-role="listview" data-inset="true" data-auto-enhanced="false"></ul>';
-        html += '</div>';
-
-        html += '<p>';
-        html += '<button type="submit" data-theme="b" data-icon="ok">OK</button>';
-        html += '<button type="button" data-icon="delete" onclick="$(this).parents(\'.popup\').popup(\'close\');">Cancel</button>';
-        html += '</p>';
-        html += '</form>';
-        html += '</div>';
-        html += '</div>';
-
-        $($.mobile.activePage).append(html);
-
-        var popup = $('#popupDirectoryPicker').popup().trigger('create').popup("open").on("popupafterclose", function () {
-
-            $('form', this).off("submit");
-            $(this).off("click").off("popupafterclose").remove();
-
-        }).on("click", ".lnkDirectory", function () {
-
-            var path = this.getAttribute('data-path');
-
-            Dashboard.refreshDirectoryBrowser(path);
-        });
-
-        var txtCurrentPath = $('#txtDirectoryPickerPath', popup);
-
-        if (options.path) {
-            txtCurrentPath.val(options.path);
-        }
-
-        $('form', popup).on('submit', function () {
-
-            if (options.callback) {
-                options.callback($('#txtDirectoryPickerPath', this).val());
-            }
-
-            return false;
-        });
-
-        Dashboard.refreshDirectoryBrowser(txtCurrentPath.val());
-    },
-
-    refreshDirectoryBrowser: function (path) {
-        var page = $.mobile.activePage;
-
-        Dashboard.showLoadingMsg();
-
-        var promise;
-                
-        if (path === "Network") {
-                promise = ApiClient.getNetworkComputers();
-            }
-        else if (path) {
-                promise = ApiClient.getDirectoryContents(path, { includeDirectories: true });
-            } else {
-            promise = ApiClient.getDrives();
-                }
-        
-        promise.done(function (folders) {
-
-            $('#txtDirectoryPickerPath', page).val(path || "");
-
-            var html = '';
-
-            if (path) {
-
-                var parentPath = path;
-
-                if (parentPath.endsWith('\\')) {
-                    parentPath = parentPath.substring(0, parentPath.length - 1);
-                }
-
-                var lastIndex = parentPath.lastIndexOf('\\');
-                parentPath = lastIndex == -1 ? "" : parentPath.substring(0, lastIndex);
-
-                if (parentPath.endsWith(':')) {
-                    parentPath += "\\";
-                }
-
-                if (parentPath == '\\') {
-                    parentPath = "Network";
-                }
-
-                html += '<li><a class="lnkDirectory" data-path="' + parentPath + '" href="#">..</a></li>';
-            }
-
-            for (var i = 0, length = folders.length; i < length; i++) {
-
-                var folder = folders[i];
-
-                html += '<li><a class="lnkDirectory" data-path="' + folder.Path + '" href="#">' + folder.Name + '</a></li>';
-            }
-
-            if (!path) {
-                html += '<li><a class="lnkDirectory" data-path="Network" href="#">Network</a></li>';
-            }
-
-            $('#ulDirectoryPickerList', page).html(html).listview('refresh');
-
-            Dashboard.hideLoadingMsg();
-
-        }).fail(function () {
-
-            $('#txtDirectoryPickerPath', page).val("");
-            $('#ulDirectoryPickerList', page).html('').listview('refresh');
-
-            Dashboard.hideLoadingMsg();
-        });
-    },
-
-    getPluginSecurityInfo: function () {
-
-        if (!Dashboard.getPluginSecurityInfoPromise) {
-            Dashboard.getPluginSecurityInfoPromise = ApiClient.getPluginSecurityInfo();
-        }
-
-        return Dashboard.getPluginSecurityInfoPromise;
-    },
-
-    resetPluginSecurityInfo: function () {
-        Dashboard.getPluginSecurityInfoPromise = null;
-    },
-
-    ensureHeader: function (page) {
-
-        if (!$('.header', page).length) {
-
-            var isLoggedIn = Dashboard.getCurrentUserId();
-
-            if (isLoggedIn) {
-
-                var promise1 = Dashboard.getCurrentUser();
-                var promise2 = Dashboard.getPluginSecurityInfo();
-
-                $.when(promise1, promise2).done(function (response1, response2) {
-
-                    Dashboard.renderHeader(page, response1[0], response2[0]);
-                });
-
-            } else {
-
-                Dashboard.renderHeader(page);
-            }
-        }
-    },
-
-    renderHeader: function (page, user, pluginSecurityInfo) {
-
-        var headerHtml = '';
-        headerHtml += '<div class="header">';
-
-        var isLibraryPage = page.hasClass('libraryPage');
-
-        headerHtml += '<a class="logo" href="index.html">';
-
-        if (page.hasClass('standalonePage')) {
-
-            headerHtml += '<img class="imgLogo" src="css/images/mblogoblackfull.png" />';
-        }
-        else if (isLibraryPage) {
-
-            headerHtml += '<img class="imgLogo" src="css/images/mblogowhitefull.png" />';
-        }
-        headerHtml += '</a>';
-
-        var imageColor = isLibraryPage ? "White" : "Black";
-
-        if (user && !page.hasClass('wizardPage')) {
-            headerHtml += '<div class="headerButtons">';
-            headerHtml += '<a class="imageLink btnCurrentUser" href="#" onclick="Dashboard.showUserFlyout();"><span class="currentUsername">' + user.Name + '</span>';
-
-            if (user.PrimaryImageTag) {
-
-                var url = ApiClient.getUserImageUrl(user.Id, {
-                    width: 225,
-                    tag: user.PrimaryImageTag,
-                    type: "Primary"
-                });
-
-                headerHtml += '<img src="' + url + '" />';
-            } else {
-                headerHtml += '<img src="css/images/currentUserDefault' + imageColor + '.png" />';
-            }
-            headerHtml += '</a>';
-
-            if (pluginSecurityInfo.IsMBSupporter) {
-                headerHtml += '<a class="imageLink" href="supporter.html"><img src="css/images/suppbadge.png" /></a>';
-            }
-            if (user.Configuration.IsAdministrator) {
-                headerHtml += '<a class="imageLink" href="dashboard.html"><img src="css/images/tools' + imageColor + '.png" /></a>';
-            }
-
-            headerHtml += '</div>';
-        }
-
-        headerHtml += '</div>';
-        page.prepend(headerHtml);
-    },
-
-    ensureToolsMenu: function (page) {
-
-        if (!page.hasClass('type-interior')) {
-            return;
-        }
-
-        var sidebar = $('.toolsSidebar', page);
-
-        if (!sidebar.length) {
-
-            var html = '<div class="content-secondary ui-bar-a toolsSidebar">';
-
-            html += '<h1><a href="index.html" class="imageLink" style="margin-left: 0;margin-right: 20px;"> <img src="css/images/home.png" /></a>Tools</h1>';
-
-            html += '<div class="sidebarLinks">';
-
-            var links = Dashboard.getToolsMenuLinks(page);
-
-            for (var i = 0, length = links.length; i < length; i++) {
-
-                var link = links[i];
-
-                if (link.href) {
-
-                    if (link.selected) {
-                        html += '<a class="selectedSidebarLink" href="' + link.href + '">' + link.name + '</a>';
-                    } else {
-                        html += '<a href="' + link.href + '">' + link.name + '</a>';
-                    }
-
-                }
-            }
-
-            // collapsible
-            html += '</div>';
-
-            // content-secondary
-            html += '</div>';
-
-            $(page).append(html);
-        }
-    },
-
-    getToolsMenuLinks: function (page) {
-
-        var pageElem = page[0];
-
-        return [{
-            name: "Dashboard",
-            href: "dashboard.html",
-            selected: pageElem.id == "dashboardPage"
-        }, {
-            name: "Media Library",
-            href: "library.html",
-            selected: pageElem.id == "mediaLibraryPage"
-        }, {
-            name: "Metadata",
-            href: "metadata.html",
-            selected: pageElem.id == "metadataConfigurationPage" || pageElem.id == "advancedMetadataConfigurationPage" || pageElem.id == "metadataImagesConfigurationPage"
-        }, {
-            name: "Plugins",
-            href: "plugins.html",
-            selected: page.hasClass("pluginConfigurationPage")
-        }, {
-            name: "User Profiles",
-            href: "userProfiles.html",
-            selected: page.hasClass("userProfilesConfigurationPage")
-        }, {
-            name: "Display Settings",
-            href: "uiSettings.html",
-            selected: pageElem.id == "displaySettingsPage"
-        }, {
-            name: "Advanced",
-            href: "advanced.html",
-            selected: pageElem.id == "advancedConfigurationPage"
-        }, {
-            name: "Scheduled Tasks",
-            href: "scheduledTasks.html",
-            selected: pageElem.id == "scheduledTasksPage" || pageElem.id == "scheduledTaskPage"
-        }, {
-            name: "Help",
-            href: "support.html",
-            selected: pageElem.id == "supportPage" || pageElem.id == "logPage" || pageElem.id == "supporterPage" || pageElem.id == "supporterKeyPage"
-        }];
-
-    },
-
-    ensureWebSocket: function (systemInfo) {
-
-        if (!("WebSocket" in window)) {
-            // Not supported by the browser
-            return;
-        }
-
-        if (Dashboard.webSocket) {
-            if (Dashboard.webSocket.readyState === WebSocket.OPEN || Dashboard.webSocket.readyState === WebSocket.CONNECTING) {
-                return;
-            }
-        }
-
-        systemInfo = systemInfo || Dashboard.lastSystemInfo;
-
-        var url = "ws://" + ApiClient.serverHostName + ":" + systemInfo.WebSocketPortNumber + "/mediabrowser";
-
-        var ws = new WebSocket(url);
-
-        ws.onmessage = Dashboard.onWebSocketMessage;
-
-        ws.onopen = function () {
-            setTimeout(function () {
-                $(document).trigger("websocketopen");
-            }, 500);
-        };
-        ws.onerror = function () {
-            setTimeout(function () {
-                $(document).trigger("websocketerror");
-            }, 0);
-        };
-        ws.onclose = function () {
-            setTimeout(function () {
-                $(document).trigger("websocketclose");
-            }, 0);
-        };
-
-        Dashboard.webSocket = ws;
-    },
-
-    resetWebSocketPingInterval: function () {
-
-        if (Dashboard.pingWebSocketInterval) {
-            clearInterval(Dashboard.pingWebSocketInterval);
-            Dashboard.pingWebSocketInterval = null;
-        }
-        Dashboard.pingWebSocketInterval = setInterval(Dashboard.pingWebSocket, 30000);
-    },
-
-    pingWebSocket: function () {
-
-        // Send a ping to the server every so often to try and keep the connection alive
-        if (Dashboard.isWebSocketOpen()) {
-            Dashboard.sendWebSocketMessage("ping");
-        }
-
-    },
-
-    onWebSocketMessage: function (msg) {
-
-        msg = JSON.parse(msg.data);
-
-        if (msg.MessageType === "LibraryChanged") {
-            Dashboard.processLibraryUpdateNotification(msg.Data);
-        }
-        else if (msg.MessageType === "UserDeleted") {
-            Dashboard.validateCurrentUser();
-        }
-        else if (msg.MessageType === "SystemInfo") {
-            Dashboard.updateSystemInfo(msg.Data);
-        }
-        else if (msg.MessageType === "HasPendingRestartChanged") {
-            Dashboard.updateSystemInfo(msg.Data);
-        }
-        else if (msg.MessageType === "UserUpdated") {
-            Dashboard.validateCurrentUser();
-
-            var user = msg.Data;
-
-            if (user.Id == Dashboard.getCurrentUserId()) {
-
-                $('.currentUsername').html(user.Name);
-            }
-        }
-        else if (msg.MessageType === "PackageInstallationCompleted") {
-            Dashboard.showPackageInstallNotification(msg.Data, "completed");
-            Dashboard.refreshSystemInfoFromServer();
-        }
-        else if (msg.MessageType === "PackageInstallationFailed") {
-            Dashboard.showPackageInstallNotification(msg.Data, "failed");
-            Dashboard.refreshSystemInfoFromServer();
-        }
-        else if (msg.MessageType === "PackageInstallationCancelled") {
-            Dashboard.showPackageInstallNotification(msg.Data, "cancelled");
-            Dashboard.refreshSystemInfoFromServer();
-        }
-        else if (msg.MessageType === "PackageInstalling") {
-            Dashboard.showPackageInstallNotification(msg.Data, "progress");
-            Dashboard.refreshSystemInfoFromServer();
-        }
-        else if (msg.MessageType === "ScheduledTaskEndExecute") {
-
-            Dashboard.showTaskCompletionNotification(msg.Data);
-        }
-
-        $(document).trigger("websocketmessage", [msg]);
-    },
-
-    sendWebSocketMessage: function (name, data) {
-
-        var msg = { MessageType: name };
-
-        if (data) {
-            msg.Data = data;
-        }
-
-        msg = JSON.stringify(msg);
-
-        Dashboard.webSocket.send(msg);
-    },
-
-    isWebSocketOpen: function () {
-        return Dashboard.webSocket && Dashboard.webSocket.readyState === WebSocket.OPEN;
-    },
-
-    showTaskCompletionNotification: function (result) {
-
-        var html = '';
-
-        if (result.Status == "Completed") {
-            html += '<img src="css/images/notifications/done.png" class="notificationIcon" />';
-            return;
-        }
-        else if (result.Status == "Cancelled") {
-            html += '<img src="css/images/notifications/info.png" class="notificationIcon" />';
-            return;
-        }
-        else {
-            html += '<img src="css/images/notifications/error.png" class="notificationIcon" />';
-        }
-
-        html += '<span>';
-        html += result.Name + " " + result.Status;
-        html += '</span>';
-
-        var timeout = 0;
-
-        if (result.Status == 'Cancelled') {
-            timeout = 2000;
-        }
-
-        Dashboard.showFooterNotification({ html: html, id: result.Id, forceShow: true, timeout: timeout });
-    },
-
-    showPackageInstallNotification: function (installation, status) {
-
-        var html = '';
-
-        if (status == 'completed') {
-            html += '<img src="css/images/notifications/done.png" class="notificationIcon" />';
-        }
-        else if (status == 'cancelled') {
-            html += '<img src="css/images/notifications/info.png" class="notificationIcon" />';
-        }
-        else if (status == 'failed') {
-            html += '<img src="css/images/notifications/error.png" class="notificationIcon" />';
-        }
-        else if (status == 'progress') {
-            html += '<img src="css/images/notifications/download.png" class="notificationIcon" />';
-        }
-
-        html += '<span style="margin-right: 1em;">';
-
-        if (status == 'completed') {
-            html += installation.Name + ' ' + installation.Version + ' installation completed';
-        }
-        else if (status == 'cancelled') {
-            html += installation.Name + ' ' + installation.Version + ' installation was cancelled';
-        }
-        else if (status == 'failed') {
-            html += installation.Name + ' ' + installation.Version + ' installation failed';
-        }
-        else if (status == 'progress') {
-            html += 'Installing ' + installation.Name + ' ' + installation.Version;
-        }
-
-        html += '</span>';
-
-        if (status == 'progress') {
-
-            var percentComplete = Math.round(installation.PercentComplete || 0);
-
-            html += '<progress style="margin-right: 1em;" max="100" value="' + percentComplete + '" title="' + percentComplete + '%">';
-            html += '' + percentComplete + '%';
-            html += '</progress>';
-
-            if (percentComplete < 100) {
-                var btnId = "btnCancel" + installation.Id;
-                html += '<button id="' + btnId + '" type="button" data-icon="delete" onclick="$(\'' + btnId + '\').button(\'disable\');Dashboard.cancelInstallation(\'' + installation.Id + '\');" data-theme="b" data-inline="true" data-mini="true">Cancel</button>';
-            }
-        }
-
-        var timeout = 0;
-
-        if (status == 'cancelled') {
-            timeout = 2000;
-        }
-
-        var forceShow = status != "progress";
-        var allowHide = status != "progress" && status != 'cancelled';
-
-        Dashboard.showFooterNotification({ html: html, id: installation.Id, timeout: timeout, forceShow: forceShow, allowHide: allowHide });
-    },
-
-    processLibraryUpdateNotification: function (data) {
-
-        var newItems = data.ItemsAdded.filter(function (a) {
-            return !a.IsFolder;
-        });
-
-        if (!Dashboard.newItems) {
-            Dashboard.newItems = [];
-        }
-
-        for (var i = 0, length = newItems.length ; i < length; i++) {
-
-            Dashboard.newItems.push(newItems[i]);
-        }
-
-        if (Dashboard.newItemTimeout) {
-            clearTimeout(Dashboard.newItemTimeout);
-        }
-
-        Dashboard.newItemTimeout = setTimeout(Dashboard.onNewItemTimerStopped, 60000);
-    },
-
-    onNewItemTimerStopped: function () {
-
-        var newItems = Dashboard.newItems;
-
-        newItems = newItems.sort(function (a, b) {
-
-            if (a.PrimaryImageTag && b.PrimaryImageTag) {
-                return 0;
-            }
-
-            if (a.PrimaryImageTag) {
-                return -1;
-            }
-
-            return 1;
-        });
-
-        Dashboard.newItems = [];
-        Dashboard.newItemTimeout = null;
-
-        // Show at most 3 notifications
-        for (var i = 0, length = Math.min(newItems.length, 3) ; i < length; i++) {
-
-            var item = newItems[i];
-
-            var data = {
-                title: "New " + item.Type,
-                body: item.Name,
-                timeout: 6000
-            };
-
-            if (item.PrimaryImageTag) {
-                data.icon = ApiClient.getImageUrl(item.Id, {
-                    width: 100,
-                    tag: item.PrimaryImageTag
-                });
-            }
-
-            WebNotifications.show(data);
-        }
-    },
-
-    ensurePageTitle: function (page) {
-
-        if (!page.hasClass('type-interior')) {
-            return;
-        }
-
-        var pageElem = page[0];
-
-        if (pageElem.hasPageTitle) {
-            return;
-        }
-
-        var parent = $('.content-primary', page);
-
-        if (!parent.length) {
-            parent = $('.ui-content', page)[0];
-        }
-
-        $(parent).prepend("<h2 class='pageTitle'>" + (document.title || "&nbsp;") + "</h2>");
-
-        pageElem.hasPageTitle = true;
-    },
-
-    setPageTitle: function (title) {
-
-        $('.pageTitle', $.mobile.activePage).html(title);
-
-        if (title) {
-            document.title = title;
-        }
-    },
-
-    metroColors: ["#6FBD45", "#4BB3DD", "#4164A5", "#E12026", "#800080", "#E1B222", "#008040", "#0094FF", "#FF00C7", "#FF870F", "#7F0037"],
-
-    getRandomMetroColor: function () {
-
-        var index = Math.floor(Math.random() * (Dashboard.metroColors.length - 1));
-
-        return Dashboard.metroColors[index];
-    }
-
-};
-
-$(function () {
-
-    var footerHtml = '<div id="footer" class="ui-bar-a">';
-
-    footerHtml += '<div id="nowPlayingBar" style="display:none;">';
-
-    footerHtml += '<button id="previousTrackButton" class="imageButton mediaButton" title="Previous Track" type="button"><img src="css/images/media/previousTrack.png" /></button>';
-
-    footerHtml += '<button id="stopButton" class="imageButton mediaButton" title="Stop" type="button" onclick="MediaPlayer.stop();"><img src="css/images/media/stop.png" /></button>';
-
-    footerHtml += '<button id="nextTrackButton" class="imageButton mediaButton" title="Next Track" type="button"><img src="css/images/media/nextTrack.png" /></button>';
-
-    footerHtml += '<div id="mediaElement"></div>';
-
-    footerHtml += '</div>';
-
-    footerHtml += '<div id="footerNotifications"></div>';
-
-    footerHtml += '</div>';
-
-
-    $(document.body).append(footerHtml);
-});
-
-Dashboard.jQueryMobileInit();
-
-$(document).on('pagebeforeshow', ".page", function () {
-
-    Dashboard.refreshSystemInfoFromServer();
-
-    var page = $(this);
-
-    Dashboard.ensureHeader(page);
-    Dashboard.ensurePageTitle(page);
-
-}).on('pageinit', ".page", function () {
-
-    var page = $(this);
-    var hasLogin = Dashboard.getCurrentUserId();
-
-    if (!hasLogin) {
-
-        if (this.id !== "loginPage" && !page.hasClass('wizardPage')) {
-
-            Dashboard.logout();
-        }
-    }
-
-    else {
-
-        Dashboard.getCurrentUser().done(function (user) {
-
-            if (user.Configuration.IsAdministrator) {
-                Dashboard.ensureToolsMenu(page);
-            }
-        });
-    }
+$.ajaxSetup({
+    crossDomain: true,
+
+    error: function (event, jqxhr, settings, exception) {
+        Dashboard.hideLoadingMsg();
+
+        if (!Dashboard.suppressAjaxErrors) {
+            setTimeout(function () {
+
+
+                var msg = event.getResponseHeader("X-Application-Error-Code") || Dashboard.defaultErrorMessage;
+
+                Dashboard.showError(msg);
+            }, 500);
+        }
+    }
+});
+
+$.support.cors = true;
+
+$(document).one('click', WebNotifications.requestPermission);
+
+var Dashboard = {
+    jQueryMobileInit: function () {
+
+        //$.mobile.defaultPageTransition = 'slide';
+
+        // Page
+        //$.mobile.page.prototype.options.theme = "a";
+        //$.mobile.page.prototype.options.headerTheme = "a";
+        //$.mobile.page.prototype.options.contentTheme = "a";
+        //$.mobile.page.prototype.options.footerTheme = "a";
+
+        //$.mobile.button.prototype.options.theme = "c";
+        $.mobile.listview.prototype.options.dividerTheme = "b";
+
+        $.mobile.popup.prototype.options.theme = "c";
+        //$.mobile.collapsible.prototype.options.contentTheme = "a";
+    },
+
+    getCurrentUser: function () {
+
+        if (!Dashboard.getUserPromise) {
+            Dashboard.getUserPromise = ApiClient.getUser(Dashboard.getCurrentUserId()).fail(Dashboard.logout);
+        }
+
+        return Dashboard.getUserPromise;
+    },
+
+    validateCurrentUser: function () {
+        Dashboard.getUserPromise = null;
+
+        if (Dashboard.getCurrentUserId()) {
+            Dashboard.getCurrentUser();
+        }
+
+        // Re-render the header
+        $('.header').remove();
+        Dashboard.ensureHeader($.mobile.activePage);
+    },
+
+    getCurrentUserId: function () {
+
+        var userId = localStorage.getItem("userId");
+
+        if (!userId) {
+            var autoLoginUserId = getParameterByName('u');
+
+            if (autoLoginUserId) {
+                userId = autoLoginUserId;
+                localStorage.setItem("userId", userId);
+            }
+        }
+
+        return userId;
+    },
+
+    setCurrentUser: function (userId) {
+        localStorage.setItem("userId", userId);
+        Dashboard.getUserPromise = null;
+    },
+
+    logout: function () {
+        localStorage.removeItem("userId");
+        Dashboard.getUserPromise = null;
+        window.location = "login.html";
+    },
+
+    showError: function (message) {
+
+        $.mobile.loading('show', {
+            theme: "e",
+            text: message,
+            textonly: true,
+            textVisible: true
+        });
+
+        setTimeout(function () {
+            $.mobile.loading('hide');
+        }, 2000);
+    },
+
+    alert: function (message) {
+
+        $.mobile.loading('show', {
+            theme: "e",
+            text: message,
+            textonly: true,
+            textVisible: true
+        });
+
+        setTimeout(function () {
+            $.mobile.loading('hide');
+        }, 2000);
+    },
+
+    updateSystemInfo: function (info) {
+
+        var isFirstLoad = !Dashboard.lastSystemInfo;
+
+        Dashboard.lastSystemInfo = info;
+        Dashboard.ensureWebSocket(info);
+
+        if (!Dashboard.initialServerVersion) {
+            Dashboard.initialServerVersion = info.Version;
+        }
+
+        if (info.HasPendingRestart) {
+
+            Dashboard.hideDashboardVersionWarning();
+            Dashboard.showServerRestartWarning();
+
+        } else {
+
+            Dashboard.hideServerRestartWarning();
+
+            if (Dashboard.initialServerVersion != info.Version) {
+
+                Dashboard.showDashboardVersionWarning();
+            }
+        }
+
+        if (isFirstLoad) {
+            Dashboard.showFailedAssemblies(info.FailedPluginAssemblies);
+        }
+
+        Dashboard.showInProgressInstallations(info.InProgressInstallations);
+    },
+
+    showFailedAssemblies: function (failedAssemblies) {
+
+        for (var i = 0, length = failedAssemblies.length; i < length; i++) {
+
+            var assembly = failedAssemblies[i];
+
+            var html = '<img src="css/images/notifications/error.png" class="notificationIcon" />';
+
+            var index = assembly.lastIndexOf('\\');
+
+            if (index != -1) {
+                assembly = assembly.substring(index + 1);
+            }
+
+            html += '<span>';
+            html += assembly + " failed to load.";
+            html += '</span>';
+
+            Dashboard.showFooterNotification({ html: html });
+
+        }
+    },
+
+    showInProgressInstallations: function (installations) {
+
+        installations = installations || [];
+
+        for (var i = 0, length = installations.length; i < length; i++) {
+
+            var installation = installations[i];
+
+            var percent = installation.PercentComplete || 0;
+
+            if (percent < 100) {
+                Dashboard.showPackageInstallNotification(installation, "progress");
+            }
+        }
+
+        if (installations.length) {
+
+            Dashboard.ensureInstallRefreshInterval();
+        } else {
+            Dashboard.stopInstallRefreshInterval();
+        }
+    },
+
+    ensureInstallRefreshInterval: function () {
+
+        if (!Dashboard.installRefreshInterval) {
+
+            if (Dashboard.isWebSocketOpen()) {
+                Dashboard.sendWebSocketMessage("SystemInfoStart", "0,350");
+            }
+            Dashboard.installRefreshInterval = 1;
+        }
+    },
+
+    stopInstallRefreshInterval: function () {
+
+        if (Dashboard.installRefreshInterval) {
+            if (Dashboard.isWebSocketOpen()) {
+                Dashboard.sendWebSocketMessage("SystemInfoStop");
+            }
+            Dashboard.installRefreshInterval = null;
+        }
+    },
+
+    cancelInstallation: function (id) {
+
+        ApiClient.cancelPackageInstallation(id).always(Dashboard.refreshSystemInfoFromServer);
+
+    },
+
+    showServerRestartWarning: function () {
+
+        var html = '<span style="margin-right: 1em;">Please restart Media Browser Server to finish updating.</span>';
+        html += '<button type="button" data-icon="refresh" onclick="Dashboard.restartServer();" data-theme="b" data-inline="true" data-mini="true">Restart Server</button>';
+
+        Dashboard.showFooterNotification({ id: "serverRestartWarning", html: html, forceShow: true, allowHide: false });
+    },
+
+    hideServerRestartWarning: function () {
+
+        $('#serverRestartWarning').remove();
+    },
+
+    showDashboardVersionWarning: function () {
+
+        var html = '<span style="margin-right: 1em;">Please refresh this page to receive new updates from the server.</span>';
+        html += '<button type="button" data-icon="refresh" onclick="Dashboard.reloadPage();" data-theme="b" data-inline="true" data-mini="true">Refresh Page</button>';
+
+        Dashboard.showFooterNotification({ id: "dashboardVersionWarning", html: html, forceShow: true, allowHide: false });
+    },
+
+    reloadPage: function () {
+
+        window.location.href = window.location.href;
+    },
+
+    hideDashboardVersionWarning: function () {
+
+        $('#dashboardVersionWarning').remove();
+    },
+
+    showFooterNotification: function (options) {
+
+        var removeOnHide = !options.id;
+
+        options.id = options.id || "notification" + new Date().getTime() + parseInt(Math.random());
+
+        var parentElem = $('#footerNotifications');
+
+        var elem = $('#' + options.id, parentElem);
+
+        if (!elem.length) {
+            elem = $('<p id="' + options.id + '" class="footerNotification"></p>').appendTo(parentElem);
+        }
+
+        var onclick = removeOnHide ? "$(\"#" + options.id + "\").remove();" : "$(\"#" + options.id + "\").hide();";
+
+        if (options.allowHide !== false) {
+            options.html += "<span style='margin-left: 1em;'><button type='button' onclick='" + onclick + "' data-icon='delete' data-iconpos='notext' data-mini='true' data-inline='true' data-theme='a'>Hide</button></span>";
+        }
+
+        if (options.forceShow) {
+            elem.show();
+        }
+
+        elem.html(options.html).trigger('create');
+
+        if (options.timeout) {
+
+            setTimeout(function () {
+
+                if (removeOnHide) {
+                    elem.remove();
+                } else {
+                    elem.hide();
+                }
+
+            }, options.timeout);
+        }
+    },
+
+    getConfigurationPageUrl: function (name) {
+        return "ConfigurationPage?name=" + encodeURIComponent(name);
+    },
+
+    navigate: function (url, preserveQueryString) {
+
+        var queryString = window.location.search;
+        if (preserveQueryString && queryString) {
+            url += queryString;
+        }
+        $.mobile.changePage(url);
+    },
+
+    showLoadingMsg: function () {
+        $.mobile.showPageLoadingMsg();
+    },
+
+    hideLoadingMsg: function () {
+        $.mobile.hidePageLoadingMsg();
+    },
+
+    processPluginConfigurationUpdateResult: function () {
+
+        Dashboard.hideLoadingMsg();
+
+        Dashboard.alert("Settings saved.");
+    },
+
+    defaultErrorMessage: "There was an error processing the request.",
+
+    processServerConfigurationUpdateResult: function (result) {
+
+        Dashboard.hideLoadingMsg();
+
+        Dashboard.alert("Settings saved.");
+    },
+
+    confirm: function (message, title, callback) {
+
+        $('#confirmFlyout').popup("close").remove();
+
+        var html = '<div data-role="popup" id="confirmFlyout" style="max-width:500px;" class="ui-corner-all">';
+
+        html += '<div class="ui-corner-top ui-bar-a" style="text-align:center;">';
+        html += '<h3>' + title + '</h3>';
+        html += '</div>';
+
+        html += '<div data-role="content" class="ui-corner-bottom ui-content">';
+
+        html += '<div style="padding: 1em .25em;margin: 0;">';
+        html += message;
+        html += '</div>';
+
+        html += '<p><button type="button" data-icon="ok" onclick="$(\'#confirmFlyout\')[0].confirm=true;$(\'#confirmFlyout\').popup(\'close\');" data-theme="b">Ok</button></p>';
+        html += '<p><button type="button" data-icon="delete" onclick="$(\'#confirmFlyout\').popup(\'close\');" data-theme="a">Cancel</button></p>';
+        html += '</div>';
+
+        html += '</div>';
+
+        $(document.body).append(html);
+
+        $('#confirmFlyout').popup().trigger('create').popup("open").on("popupafterclose", function () {
+
+            if (callback) {
+                callback(this.confirm == true);
+            }
+
+            $(this).off("popupafterclose").remove();
+        });
+    },
+
+    refreshSystemInfoFromServer: function () {
+        ApiClient.getSystemInfo().done(function (info) {
+
+            Dashboard.updateSystemInfo(info);
+        });
+    },
+
+    restartServer: function () {
+
+        Dashboard.suppressAjaxErrors = true;
+        Dashboard.showLoadingMsg();
+
+        ApiClient.performPendingRestart().done(function () {
+
+            setTimeout(function () {
+                Dashboard.reloadPageWhenServerAvailable();
+            }, 500);
+
+        }).fail(function () {
+            Dashboard.suppressAjaxErrors = false;
+        });
+    },
+
+    reloadPageWhenServerAvailable: function (retryCount) {
+
+        ApiClient.getSystemInfo().done(function () {
+            Dashboard.reloadPage();
+
+        }).fail(function () {
+            setTimeout(function () {
+
+                retryCount = retryCount || 0;
+                retryCount++;
+
+                if (retryCount < 10) {
+                    Dashboard.reloadPageWhenServerAvailable(retryCount);
+                } else {
+                    Dashboard.suppressAjaxErrors = false;
+                }
+            }, 500);
+        });
+    },
+
+    getPosterViewHtml: function (options) {
+
+        var html = "";
+
+        for (var i = 0, length = options.items.length; i < length; i++) {
+            var item = options.items[i];
+
+            var hasPrimaryImage = item.ImageTags && item.ImageTags.Primary;
+
+            var href = item.IsFolder ? "#" : "itemDetails.html?id=" + item.Id;
+
+            html += "<div class='posterViewItem'><a href='" + href + "'>";
+
+            if (options.preferBackdrop && item.BackdropImageTags && item.BackdropImageTags.length) {
+                html += "<img src='" + ApiClient.getImageUrl(item.Id, {
+                    type: "Backdrop",
+                    height: 198,
+                    width: 352,
+                    tag: item.BackdropImageTags[0]
+                }) + "' />";
+            } else if (hasPrimaryImage) {
+                html += "<img src='" + ApiClient.getImageUrl(item.Id, {
+                    type: "Primary",
+                    height: 300,
+                    tag: item.ImageTags.Primary
+                }) + "' />";
+            }
+            else if (item.BackdropImageTags && item.BackdropImageTags.length) {
+                html += "<img src='" + ApiClient.getImageUrl(item.Id, {
+                    type: "Backdrop",
+                    height: 198,
+                    width: 352,
+                    tag: item.BackdropImageTags[0]
+                }) + "' />";
+            } else {
+                html += "<img style='background:" + Dashboard.getRandomMetroColor() + ";' src='css/images/defaultCollectionImage.png' />";
+            }
+
+            if (options.showTitle || !hasPrimaryImage || (item.Type !== 'Movie' && item.Type !== 'Series' && item.Type !== 'Season')) {
+                html += "<div class='posterViewItemText'>";
+                html += "<div>" + item.Name + "</div>";
+                html += "</div>"
+            }
+
+            html += "</a></div>";
+        }
+
+        return html;
+    },
+
+    showUserFlyout: function () {
+
+        Dashboard.getCurrentUser().done(function (user) {
+
+            var html = '<div data-role="popup" id="userFlyout" style="max-width:400px;margin-top:50px;margin-right:20px;" class="ui-corner-all" data-position-to=".btnCurrentUser:visible">';
+
+            html += '<a href="#" data-rel="back" data-role="button" data-theme="a" data-icon="delete" data-iconpos="notext" class="ui-btn-right">Close</a>';
+
+            html += '<div class="ui-corner-top ui-bar-a" style="text-align:center;">';
+            html += '<h3>' + user.Name + '</h3>';
+            html += '</div>';
+
+            html += '<div data-role="content" class="ui-corner-bottom ui-content">';
+
+            html += '<p style="text-align:center;">';
+
+            var imageUrl = user.PrimaryImageTag ? ApiClient.getUserImageUrl(user.Id, {
+
+                height: 400,
+                tag: user.PrimaryImageTag,
+                type: "Primary"
+
+            }) : "css/images/userFlyoutDefault.png";
+
+            html += '<img style="max-height:125px;max-width:200px;" src="' + imageUrl + '" />';
+            html += '</p>';
+
+            html += '<p><button type="button" onclick="Dashboard.navigate(\'editUser.html?userId=' + user.Id + '\');" data-icon="user">View Profile</button></p>';
+            html += '<p><button type="button" onclick="Dashboard.logout();" data-icon="lock">Sign Out</button></p>';
+            html += '</div>';
+
+            html += '</div>';
+
+            $(document.body).append(html);
+
+            $('#userFlyout').popup().trigger('create').popup("open").on("popupafterclose", function () {
+
+                $(this).off("popupafterclose").remove();
+            });
+        });
+    },
+
+    selectDirectory: function (options) {
+
+        options = options || {};
+
+        options.header = options.header || "Select Media Path";
+
+        var html = '<div data-role="popup" id="popupDirectoryPicker" class="ui-corner-all popup">';
+
+        html += '<div class="ui-corner-top ui-bar-a" style="text-align: center; padding: 0 20px;">';
+        html += '<h3>' + options.header + '</h3>';
+        html += '</div>';
+
+        html += '<div data-role="content" class="ui-corner-bottom ui-content">';
+        html += '<form>';
+        html += '<p>Browse to or enter the folder containing the media. Network paths (UNC) are recommended for optimal playback performance.</p>';
+
+        html += '<div data-role="fieldcontain" style="margin:0;">';
+        html += '<label for="txtDirectoryPickerPath">Current Folder:</label>';
+        html += '<input id="txtDirectoryPickerPath" name="txtDirectoryPickerPath" type="text" onchange="Dashboard.refreshDirectoryBrowser(this.value);" required="required" style="font-weight:bold;" />';
+        html += '</div>';
+
+        html += '<div style="height: 300px; overflow-y: auto;">';
+        html += '<ul id="ulDirectoryPickerList" data-role="listview" data-inset="true" data-auto-enhanced="false"></ul>';
+        html += '</div>';
+
+        html += '<p>';
+        html += '<button type="submit" data-theme="b" data-icon="ok">OK</button>';
+        html += '<button type="button" data-icon="delete" onclick="$(this).parents(\'.popup\').popup(\'close\');">Cancel</button>';
+        html += '</p>';
+        html += '</form>';
+        html += '</div>';
+        html += '</div>';
+
+        $($.mobile.activePage).append(html);
+
+        var popup = $('#popupDirectoryPicker').popup().trigger('create').popup("open").on("popupafterclose", function () {
+
+            $('form', this).off("submit");
+            $(this).off("click").off("popupafterclose").remove();
+
+        }).on("click", ".lnkDirectory", function () {
+
+            var path = this.getAttribute('data-path');
+
+            Dashboard.refreshDirectoryBrowser(path);
+        });
+
+        var txtCurrentPath = $('#txtDirectoryPickerPath', popup);
+
+        if (options.path) {
+            txtCurrentPath.val(options.path);
+        }
+
+        $('form', popup).on('submit', function () {
+
+            if (options.callback) {
+                options.callback($('#txtDirectoryPickerPath', this).val());
+            }
+
+            return false;
+        });
+
+        Dashboard.refreshDirectoryBrowser(txtCurrentPath.val());
+    },
+
+    refreshDirectoryBrowser: function (path) {
+        var page = $.mobile.activePage;
+
+        Dashboard.showLoadingMsg();
+
+        var promise;
+                
+        if (path === "Network") {
+                promise = ApiClient.getNetworkComputers();
+            }
+        else if (path) {
+                promise = ApiClient.getDirectoryContents(path, { includeDirectories: true });
+            } else {
+            promise = ApiClient.getDrives();
+                }
+        
+        promise.done(function (folders) {
+
+            $('#txtDirectoryPickerPath', page).val(path || "");
+
+            var html = '';
+
+            if (path) {
+
+                var parentPath = path;
+
+                if (parentPath.endsWith('\\')) {
+                    parentPath = parentPath.substring(0, parentPath.length - 1);
+                }
+
+                var lastIndex = parentPath.lastIndexOf('\\');
+                parentPath = lastIndex == -1 ? "" : parentPath.substring(0, lastIndex);
+
+                if (parentPath.endsWith(':')) {
+                    parentPath += "\\";
+                }
+
+                if (parentPath == '\\') {
+                    parentPath = "Network";
+                }
+
+                html += '<li><a class="lnkDirectory" data-path="' + parentPath + '" href="#">..</a></li>';
+            }
+
+            for (var i = 0, length = folders.length; i < length; i++) {
+
+                var folder = folders[i];
+
+                html += '<li><a class="lnkDirectory" data-path="' + folder.Path + '" href="#">' + folder.Name + '</a></li>';
+            }
+
+            if (!path) {
+                html += '<li><a class="lnkDirectory" data-path="Network" href="#">Network</a></li>';
+            }
+
+            $('#ulDirectoryPickerList', page).html(html).listview('refresh');
+
+            Dashboard.hideLoadingMsg();
+
+        }).fail(function () {
+
+            $('#txtDirectoryPickerPath', page).val("");
+            $('#ulDirectoryPickerList', page).html('').listview('refresh');
+
+            Dashboard.hideLoadingMsg();
+        });
+    },
+
+    getPluginSecurityInfo: function () {
+
+        if (!Dashboard.getPluginSecurityInfoPromise) {
+            Dashboard.getPluginSecurityInfoPromise = ApiClient.getPluginSecurityInfo();
+        }
+
+        return Dashboard.getPluginSecurityInfoPromise;
+    },
+
+    resetPluginSecurityInfo: function () {
+        Dashboard.getPluginSecurityInfoPromise = null;
+    },
+
+    ensureHeader: function (page) {
+
+        if (!$('.header', page).length) {
+
+            var isLoggedIn = Dashboard.getCurrentUserId();
+
+            if (isLoggedIn) {
+
+                var promise1 = Dashboard.getCurrentUser();
+                var promise2 = Dashboard.getPluginSecurityInfo();
+
+                $.when(promise1, promise2).done(function (response1, response2) {
+
+                    Dashboard.renderHeader(page, response1[0], response2[0]);
+                });
+
+            } else {
+
+                Dashboard.renderHeader(page);
+            }
+        }
+    },
+
+    renderHeader: function (page, user, pluginSecurityInfo) {
+
+        var headerHtml = '';
+        headerHtml += '<div class="header">';
+
+        var isLibraryPage = page.hasClass('libraryPage');
+
+        headerHtml += '<a class="logo" href="index.html">';
+
+        if (page.hasClass('standalonePage')) {
+
+            headerHtml += '<img class="imgLogoIcon" src="css/images/mblogoicon.png" /><img class="imgLogoText" src="css/images/mblogotextblack.png" />';
+        }
+        else if (isLibraryPage) {
+
+            headerHtml += '<img class="imgLogoIcon" src="css/images/mblogoicon.png" /><img class="imgLogoText" src="css/images/mblogotextwhite.png" />';
+        }
+        headerHtml += '</a>';
+
+        var imageColor = isLibraryPage ? "White" : "Black";
+
+        if (user && !page.hasClass('wizardPage')) {
+            headerHtml += '<div class="headerButtons">';
+            headerHtml += '<a class="imageLink btnCurrentUser" href="#" onclick="Dashboard.showUserFlyout();"><span class="currentUsername">' + user.Name + '</span>';
+
+            if (user.PrimaryImageTag) {
+
+                var url = ApiClient.getUserImageUrl(user.Id, {
+                    width: 225,
+                    tag: user.PrimaryImageTag,
+                    type: "Primary"
+                });
+
+                headerHtml += '<img src="' + url + '" />';
+            } else {
+                headerHtml += '<img src="css/images/currentUserDefault' + imageColor + '.png" />';
+            }
+            headerHtml += '</a>';
+
+            if (pluginSecurityInfo.IsMBSupporter) {
+                headerHtml += '<a class="imageLink" href="supporter.html"><img src="css/images/suppbadge.png" /></a>';
+            }
+            if (user.Configuration.IsAdministrator) {
+                headerHtml += '<a class="imageLink" href="dashboard.html"><img src="css/images/tools' + imageColor + '.png" /></a>';
+            }
+
+            headerHtml += '</div>';
+        }
+
+        headerHtml += '</div>';
+        page.prepend(headerHtml);
+    },
+
+    ensureToolsMenu: function (page) {
+
+        if (!page.hasClass('type-interior')) {
+            return;
+        }
+
+        var sidebar = $('.toolsSidebar', page);
+
+        if (!sidebar.length) {
+
+            var html = '<div class="content-secondary ui-bar-a toolsSidebar">';
+
+            html += '<h1><a href="index.html" class="imageLink" style="margin-left: 0;margin-right: 20px;"> <img src="css/images/home.png" /></a>Tools</h1>';
+
+            html += '<div class="sidebarLinks">';
+
+            var links = Dashboard.getToolsMenuLinks(page);
+
+            for (var i = 0, length = links.length; i < length; i++) {
+
+                var link = links[i];
+
+                if (link.href) {
+
+                    if (link.selected) {
+                        html += '<a class="selectedSidebarLink" href="' + link.href + '">' + link.name + '</a>';
+                    } else {
+                        html += '<a href="' + link.href + '">' + link.name + '</a>';
+                    }
+
+                }
+            }
+
+            // collapsible
+            html += '</div>';
+
+            // content-secondary
+            html += '</div>';
+
+            $(page).append(html);
+        }
+    },
+
+    getToolsMenuLinks: function (page) {
+
+        var pageElem = page[0];
+
+        return [{
+            name: "Dashboard",
+            href: "dashboard.html",
+            selected: pageElem.id == "dashboardPage"
+        }, {
+            name: "Media Library",
+            href: "library.html",
+            selected: pageElem.id == "mediaLibraryPage"
+        }, {
+            name: "Metadata",
+            href: "metadata.html",
+            selected: pageElem.id == "metadataConfigurationPage" || pageElem.id == "advancedMetadataConfigurationPage" || pageElem.id == "metadataImagesConfigurationPage"
+        }, {
+            name: "Plugins",
+            href: "plugins.html",
+            selected: page.hasClass("pluginConfigurationPage")
+        }, {
+            name: "User Profiles",
+            href: "userProfiles.html",
+            selected: page.hasClass("userProfilesConfigurationPage")
+        }, {
+            name: "Display Settings",
+            href: "uiSettings.html",
+            selected: pageElem.id == "displaySettingsPage"
+        }, {
+            name: "Advanced",
+            href: "advanced.html",
+            selected: pageElem.id == "advancedConfigurationPage"
+        }, {
+            name: "Scheduled Tasks",
+            href: "scheduledTasks.html",
+            selected: pageElem.id == "scheduledTasksPage" || pageElem.id == "scheduledTaskPage"
+        }, {
+            name: "Help",
+            href: "support.html",
+            selected: pageElem.id == "supportPage" || pageElem.id == "logPage" || pageElem.id == "supporterPage" || pageElem.id == "supporterKeyPage"
+        }];
+
+    },
+
+    ensureWebSocket: function (systemInfo) {
+
+        if (!("WebSocket" in window)) {
+            // Not supported by the browser
+            return;
+        }
+
+        if (Dashboard.webSocket) {
+            if (Dashboard.webSocket.readyState === WebSocket.OPEN || Dashboard.webSocket.readyState === WebSocket.CONNECTING) {
+                return;
+            }
+        }
+
+        systemInfo = systemInfo || Dashboard.lastSystemInfo;
+
+        var url = "ws://" + ApiClient.serverHostName + ":" + systemInfo.WebSocketPortNumber + "/mediabrowser";
+
+        var ws = new WebSocket(url);
+
+        ws.onmessage = Dashboard.onWebSocketMessage;
+
+        ws.onopen = function () {
+            setTimeout(function () {
+                $(document).trigger("websocketopen");
+            }, 500);
+        };
+        ws.onerror = function () {
+            setTimeout(function () {
+                $(document).trigger("websocketerror");
+            }, 0);
+        };
+        ws.onclose = function () {
+            setTimeout(function () {
+                $(document).trigger("websocketclose");
+            }, 0);
+        };
+
+        Dashboard.webSocket = ws;
+    },
+
+    resetWebSocketPingInterval: function () {
+
+        if (Dashboard.pingWebSocketInterval) {
+            clearInterval(Dashboard.pingWebSocketInterval);
+            Dashboard.pingWebSocketInterval = null;
+        }
+        Dashboard.pingWebSocketInterval = setInterval(Dashboard.pingWebSocket, 30000);
+    },
+
+    pingWebSocket: function () {
+
+        // Send a ping to the server every so often to try and keep the connection alive
+        if (Dashboard.isWebSocketOpen()) {
+            Dashboard.sendWebSocketMessage("ping");
+        }
+
+    },
+
+    onWebSocketMessage: function (msg) {
+
+        msg = JSON.parse(msg.data);
+
+        if (msg.MessageType === "LibraryChanged") {
+            Dashboard.processLibraryUpdateNotification(msg.Data);
+        }
+        else if (msg.MessageType === "UserDeleted") {
+            Dashboard.validateCurrentUser();
+        }
+        else if (msg.MessageType === "SystemInfo") {
+            Dashboard.updateSystemInfo(msg.Data);
+        }
+        else if (msg.MessageType === "HasPendingRestartChanged") {
+            Dashboard.updateSystemInfo(msg.Data);
+        }
+        else if (msg.MessageType === "UserUpdated") {
+            Dashboard.validateCurrentUser();
+
+            var user = msg.Data;
+
+            if (user.Id == Dashboard.getCurrentUserId()) {
+
+                $('.currentUsername').html(user.Name);
+            }
+        }
+        else if (msg.MessageType === "PackageInstallationCompleted") {
+            Dashboard.showPackageInstallNotification(msg.Data, "completed");
+            Dashboard.refreshSystemInfoFromServer();
+        }
+        else if (msg.MessageType === "PackageInstallationFailed") {
+            Dashboard.showPackageInstallNotification(msg.Data, "failed");
+            Dashboard.refreshSystemInfoFromServer();
+        }
+        else if (msg.MessageType === "PackageInstallationCancelled") {
+            Dashboard.showPackageInstallNotification(msg.Data, "cancelled");
+            Dashboard.refreshSystemInfoFromServer();
+        }
+        else if (msg.MessageType === "PackageInstalling") {
+            Dashboard.showPackageInstallNotification(msg.Data, "progress");
+            Dashboard.refreshSystemInfoFromServer();
+        }
+        else if (msg.MessageType === "ScheduledTaskEndExecute") {
+
+            Dashboard.showTaskCompletionNotification(msg.Data);
+        }
+
+        $(document).trigger("websocketmessage", [msg]);
+    },
+
+    sendWebSocketMessage: function (name, data) {
+
+        var msg = { MessageType: name };
+
+        if (data) {
+            msg.Data = data;
+        }
+
+        msg = JSON.stringify(msg);
+
+        Dashboard.webSocket.send(msg);
+    },
+
+    isWebSocketOpen: function () {
+        return Dashboard.webSocket && Dashboard.webSocket.readyState === WebSocket.OPEN;
+    },
+
+    showTaskCompletionNotification: function (result) {
+
+        var html = '';
+
+        if (result.Status == "Completed") {
+            html += '<img src="css/images/notifications/done.png" class="notificationIcon" />';
+            return;
+        }
+        else if (result.Status == "Cancelled") {
+            html += '<img src="css/images/notifications/info.png" class="notificationIcon" />';
+            return;
+        }
+        else {
+            html += '<img src="css/images/notifications/error.png" class="notificationIcon" />';
+        }
+
+        html += '<span>';
+        html += result.Name + " " + result.Status;
+        html += '</span>';
+
+        var timeout = 0;
+
+        if (result.Status == 'Cancelled') {
+            timeout = 2000;
+        }
+
+        Dashboard.showFooterNotification({ html: html, id: result.Id, forceShow: true, timeout: timeout });
+    },
+
+    showPackageInstallNotification: function (installation, status) {
+
+        var html = '';
+
+        if (status == 'completed') {
+            html += '<img src="css/images/notifications/done.png" class="notificationIcon" />';
+        }
+        else if (status == 'cancelled') {
+            html += '<img src="css/images/notifications/info.png" class="notificationIcon" />';
+        }
+        else if (status == 'failed') {
+            html += '<img src="css/images/notifications/error.png" class="notificationIcon" />';
+        }
+        else if (status == 'progress') {
+            html += '<img src="css/images/notifications/download.png" class="notificationIcon" />';
+        }
+
+        html += '<span style="margin-right: 1em;">';
+
+        if (status == 'completed') {
+            html += installation.Name + ' ' + installation.Version + ' installation completed';
+        }
+        else if (status == 'cancelled') {
+            html += installation.Name + ' ' + installation.Version + ' installation was cancelled';
+        }
+        else if (status == 'failed') {
+            html += installation.Name + ' ' + installation.Version + ' installation failed';
+        }
+        else if (status == 'progress') {
+            html += 'Installing ' + installation.Name + ' ' + installation.Version;
+        }
+
+        html += '</span>';
+
+        if (status == 'progress') {
+
+            var percentComplete = Math.round(installation.PercentComplete || 0);
+
+            html += '<progress style="margin-right: 1em;" max="100" value="' + percentComplete + '" title="' + percentComplete + '%">';
+            html += '' + percentComplete + '%';
+            html += '</progress>';
+
+            if (percentComplete < 100) {
+                var btnId = "btnCancel" + installation.Id;
+                html += '<button id="' + btnId + '" type="button" data-icon="delete" onclick="$(\'' + btnId + '\').button(\'disable\');Dashboard.cancelInstallation(\'' + installation.Id + '\');" data-theme="b" data-inline="true" data-mini="true">Cancel</button>';
+            }
+        }
+
+        var timeout = 0;
+
+        if (status == 'cancelled') {
+            timeout = 2000;
+        }
+
+        var forceShow = status != "progress";
+        var allowHide = status != "progress" && status != 'cancelled';
+
+        Dashboard.showFooterNotification({ html: html, id: installation.Id, timeout: timeout, forceShow: forceShow, allowHide: allowHide });
+    },
+
+    processLibraryUpdateNotification: function (data) {
+
+        var newItems = data.ItemsAdded.filter(function (a) {
+            return !a.IsFolder;
+        });
+
+        if (!Dashboard.newItems) {
+            Dashboard.newItems = [];
+        }
+
+        for (var i = 0, length = newItems.length ; i < length; i++) {
+
+            Dashboard.newItems.push(newItems[i]);
+        }
+
+        if (Dashboard.newItemTimeout) {
+            clearTimeout(Dashboard.newItemTimeout);
+        }
+
+        Dashboard.newItemTimeout = setTimeout(Dashboard.onNewItemTimerStopped, 60000);
+    },
+
+    onNewItemTimerStopped: function () {
+
+        var newItems = Dashboard.newItems;
+
+        newItems = newItems.sort(function (a, b) {
+
+            if (a.PrimaryImageTag && b.PrimaryImageTag) {
+                return 0;
+            }
+
+            if (a.PrimaryImageTag) {
+                return -1;
+            }
+
+            return 1;
+        });
+
+        Dashboard.newItems = [];
+        Dashboard.newItemTimeout = null;
+
+        // Show at most 3 notifications
+        for (var i = 0, length = Math.min(newItems.length, 3) ; i < length; i++) {
+
+            var item = newItems[i];
+
+            var data = {
+                title: "New " + item.Type,
+                body: item.Name,
+                timeout: 6000
+            };
+
+            if (item.PrimaryImageTag) {
+                data.icon = ApiClient.getImageUrl(item.Id, {
+                    width: 100,
+                    tag: item.PrimaryImageTag
+                });
+            }
+
+            WebNotifications.show(data);
+        }
+    },
+
+    ensurePageTitle: function (page) {
+
+        if (!page.hasClass('type-interior')) {
+            return;
+        }
+
+        var pageElem = page[0];
+
+        if (pageElem.hasPageTitle) {
+            return;
+        }
+
+        var parent = $('.content-primary', page);
+
+        if (!parent.length) {
+            parent = $('.ui-content', page)[0];
+        }
+
+        $(parent).prepend("<h2 class='pageTitle'>" + (document.title || "&nbsp;") + "</h2>");
+
+        pageElem.hasPageTitle = true;
+    },
+
+    setPageTitle: function (title) {
+
+        $('.pageTitle', $.mobile.activePage).html(title);
+
+        if (title) {
+            document.title = title;
+        }
+    },
+
+    metroColors: ["#6FBD45", "#4BB3DD", "#4164A5", "#E12026", "#800080", "#E1B222", "#008040", "#0094FF", "#FF00C7", "#FF870F", "#7F0037"],
+
+    getRandomMetroColor: function () {
+
+        var index = Math.floor(Math.random() * (Dashboard.metroColors.length - 1));
+
+        return Dashboard.metroColors[index];
+    }
+
+};
+
+$(function () {
+
+    var footerHtml = '<div id="footer" class="ui-bar-a">';
+
+    footerHtml += '<div id="nowPlayingBar" style="display:none;">';
+
+    footerHtml += '<button id="previousTrackButton" class="imageButton mediaButton" title="Previous Track" type="button"><img src="css/images/media/previousTrack.png" /></button>';
+
+    footerHtml += '<button id="stopButton" class="imageButton mediaButton" title="Stop" type="button" onclick="MediaPlayer.stop();"><img src="css/images/media/stop.png" /></button>';
+
+    footerHtml += '<button id="nextTrackButton" class="imageButton mediaButton" title="Next Track" type="button"><img src="css/images/media/nextTrack.png" /></button>';
+
+    footerHtml += '<div id="mediaElement"></div>';
+
+    footerHtml += '</div>';
+
+    footerHtml += '<div id="footerNotifications"></div>';
+
+    footerHtml += '</div>';
+
+
+    $(document.body).append(footerHtml);
+});
+
+Dashboard.jQueryMobileInit();
+
+$(document).on('pagebeforeshow', ".page", function () {
+
+    Dashboard.refreshSystemInfoFromServer();
+
+    var page = $(this);
+
+    Dashboard.ensureHeader(page);
+    Dashboard.ensurePageTitle(page);
+
+}).on('pageinit', ".page", function () {
+
+    var page = $(this);
+    var hasLogin = Dashboard.getCurrentUserId();
+
+    if (!hasLogin) {
+
+        if (this.id !== "loginPage" && !page.hasClass('wizardPage')) {
+
+            Dashboard.logout();
+        }
+    }
+
+    else {
+
+        Dashboard.getCurrentUser().done(function (user) {
+
+            if (user.Configuration.IsAdministrator) {
+                Dashboard.ensureToolsMenu(page);
+            }
+        });
+    }
 });

+ 412 - 415
MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj

@@ -1,416 +1,413 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProjectGuid>{5624B7B5-B5A7-41D8-9F10-CC5611109619}</ProjectGuid>
-    <OutputType>Library</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>MediaBrowser.WebDashboard</RootNamespace>
-    <AssemblyName>MediaBrowser.WebDashboard</AssemblyName>
-    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
-    <FileAlignment>512</FileAlignment>
-    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
-    <RestorePackages>true</RestorePackages>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup>
-    <RunPostBuildEvent>Always</RunPostBuildEvent>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="ServiceStack, Version=3.9.37.0, Culture=neutral, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\packages\ServiceStack.3.9.37\lib\net35\ServiceStack.dll</HintPath>
-    </Reference>
-    <Reference Include="ServiceStack.Common, Version=3.9.37.0, Culture=neutral, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\packages\ServiceStack.Common.3.9.37\lib\net35\ServiceStack.Common.dll</HintPath>
-    </Reference>
-    <Reference Include="ServiceStack.Interfaces, Version=3.9.37.0, Culture=neutral, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\packages\ServiceStack.Common.3.9.37\lib\net35\ServiceStack.Interfaces.dll</HintPath>
-    </Reference>
-    <Reference Include="ServiceStack.OrmLite, Version=3.9.37.0, Culture=neutral, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\packages\ServiceStack.OrmLite.SqlServer.3.9.37\lib\ServiceStack.OrmLite.dll</HintPath>
-    </Reference>
-    <Reference Include="ServiceStack.OrmLite.SqlServer, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\packages\ServiceStack.OrmLite.SqlServer.3.9.37\lib\ServiceStack.OrmLite.SqlServer.dll</HintPath>
-    </Reference>
-    <Reference Include="ServiceStack.Redis, Version=3.9.37.0, Culture=neutral, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\packages\ServiceStack.Redis.3.9.37\lib\net35\ServiceStack.Redis.dll</HintPath>
-    </Reference>
-    <Reference Include="ServiceStack.ServiceInterface, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\packages\ServiceStack.3.9.37\lib\net35\ServiceStack.ServiceInterface.dll</HintPath>
-    </Reference>
-    <Reference Include="ServiceStack.Text, Version=3.9.37.0, Culture=neutral, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\packages\ServiceStack.Text.3.9.37\lib\net35\ServiceStack.Text.dll</HintPath>
-    </Reference>
-    <Reference Include="System" />
-    <Reference Include="System.ComponentModel.Composition" />
-    <Reference Include="System.Core" />
-    <Reference Include="System.Runtime.Serialization" />
-    <Reference Include="System.Xml.Linq" />
-    <Reference Include="System.Data.DataSetExtensions" />
-    <Reference Include="Microsoft.CSharp" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="..\SharedVersion.cs">
-      <Link>Properties\SharedVersion.cs</Link>
-    </Compile>
-    <Compile Include="Api\DashboardInfo.cs" />
-    <Compile Include="Api\DashboardService.cs" />
-    <Compile Include="Api\DashboardInfoWebSocketListener.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\MediaBrowser.Common\MediaBrowser.Common.csproj">
-      <Project>{9142eefa-7570-41e1-bfcc-468bb571af2f}</Project>
-      <Name>MediaBrowser.Common</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\MediaBrowser.Controller\MediaBrowser.Controller.csproj">
-      <Project>{17e1f4e6-8abd-4fe5-9ecf-43d4b6087ba2}</Project>
-      <Name>MediaBrowser.Controller</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj">
-      <Project>{7eeeb4bb-f3e8-48fc-b4c5-70f0fff8329b}</Project>
-      <Name>MediaBrowser.Model</Name>
-    </ProjectReference>
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\index.html" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\advanced.html" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\dashboard.html" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\scripts\Site.js" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\site.css" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\library.html" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\metadata.html" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\userProfiles.html" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\plugins.html" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\login.html" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\logindefault.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\uiSettings.html" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\editUser.html" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\favicon.ico" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\touchicon.png" />
-    <EmbeddedResource Include="Html\css\images\touchicon114.png" />
-    <EmbeddedResource Include="Html\css\images\touchicon72.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\iossplash.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\updatePassword.html" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\userImage.html" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\scripts\IndexPage.js" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\mblogowhitefull.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\mblogoblackfull.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\defaultCollectionImage.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\toolsWhite.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\currentUserDefaultWhite.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\rightArrow.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\userFlyoutDefault.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\scripts\MediaLibraryPage.js" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\scripts\DisplaySettingsPage.js" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\scripts\PluginsPage.js" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\scripts\MetadataConfigurationPage.js" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\scripts\LoginPage.js" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\scripts\UpdatePasswordPage.js" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\scripts\AdvancedConfigurationPage.js" />
-    <EmbeddedResource Include="Html\scripts\EditUserPage.js" />
-    <EmbeddedResource Include="Html\scripts\UserImagePage.js" />
-    <EmbeddedResource Include="Html\scripts\UserProfilesPage.js" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\advancedMetadata.html" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\scripts\AdvancedMetadataConfigurationPage.js" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\pluginUpdates.html" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\scripts\PluginUpdatesPage.js" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\addPlugin.html" />
-    <EmbeddedResource Include="Html\scripts\AddPluginPage.js" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\bg.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\pluginCatalog.html" />
-    <EmbeddedResource Include="Html\scripts\PluginCatalogPage.js" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\leftArrowBlack.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\leftArrowWhite.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\currentUserDefaultBlack.png" />
-    <EmbeddedResource Include="Html\css\images\toolsBlack.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\scheduledTasks.html" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\scripts\ScheduledTasksPage.js" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\scheduledTask.html" />
-    <EmbeddedResource Include="Html\scripts\ScheduledTaskPage.js" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\wizardStart.html" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\wizardFinish.html" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\wizardUser.html" />
-    <EmbeddedResource Include="Html\wizardLibrary.html" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\scripts\WizardStartPage.js" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\scripts\WizardUserPage.js" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\cloudNetwork.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\movieFolder.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\checkmarkblack.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\log.html" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\scripts\LogPage.js" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\metadataImages.html" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\scripts\MetadataImagesPage.js" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\scripts\DashboardPage.js" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\checkMarkGreen.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\clients\html5.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\clients\android.png" />
-    <EmbeddedResource Include="Html\css\images\clients\ios.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\clients\mb.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\clients\windowsrt.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\clients\windowsphone.png" />
-    <EmbeddedResource Include="Html\css\images\clients\win8.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\notifications\download.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\scripts\Extensions.js" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\support.html" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\scripts\SupporterPage.js" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\supporter.html" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\suppbadge.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\premiumflag.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\supporterKey.html" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\scripts\SupporterKeyPage.js" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\donatepp.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\font-awesome\faicons-v2.png" />
-    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\font-awesome\faicons.png" />
-    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\font-awesome\images\ajax-loader.png" />
-    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\font-awesome\images\icons-18-black-pack.png" />
-    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\font-awesome\images\icons-18-white-pack.png" />
-    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\font-awesome\images\icons-36-black-pack.png" />
-    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\font-awesome\images\icons-36-white-pack.png" />
-    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\font-awesome\index.html" />
-    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\font-awesome\jqm-icon-pack-3.0.0-fa.css" />
-    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\original\images\ajax-loader.gif" />
-    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\original\images\ajax-loader.png" />
-    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\original\images\icons-18-black-pack.png" />
-    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\original\images\icons-18-white-pack.png" />
-    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\original\images\icons-36-black-pack.png" />
-    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\original\images\icons-36-white-pack.png" />
-    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\original\index.html" />
-    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\original\jqm-icon-pack-2.0-original.css" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\font-awesome\font\fontawesome-webfont.eot" />
-    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\font-awesome\font\fontawesome-webfont.ttf" />
-    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\font-awesome\font\fontawesome-webfont.woff" />
-    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\font-awesome\font\FontAwesome.otf" />
-    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\font-awesome\jqm-icon-pack-3.0.0-fa.scss" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\registerpp.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\home.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\notifications\done.png" />
-    <EmbeddedResource Include="Html\css\images\notifications\error.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\notifications\cancelled.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\notifications\info.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\itemDetails.html" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\scripts\ItemDetailPage.js" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Html\css\images\media\playCircle.png" />
-    <EmbeddedResource Include="Html\css\images\media\nextTrack.png" />
-    <EmbeddedResource Include="Html\css\images\media\pause.png" />
-    <EmbeddedResource Include="Html\css\images\media\play.png" />
-    <EmbeddedResource Include="Html\css\images\media\previousTrack.png" />
-    <EmbeddedResource Include="Html\css\images\media\stop.png" />
-    <EmbeddedResource Include="Html\css\images\itemDetails\videoDefault.png" />
-    <EmbeddedResource Include="Html\css\images\itemDetails\audioDefault.png" />
-    <EmbeddedResource Include="Html\css\images\itemDetails\gameDefault.png" />
-    <Content Include="Html\css\images\stars.png" />
-    <EmbeddedResource Include="Html\scripts\MediaPlayer.js" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="packages.config" />
-  </ItemGroup>
-  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
-  <PropertyGroup>
-    <PostBuildEvent>xcopy "$(TargetPath)" "$(SolutionDir)\MediaBrowser.ServerApplication\CorePlugins\" /y</PostBuildEvent>
-  </PropertyGroup>
-  <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
-       Other similar extension points exist, see Microsoft.Common.targets.
-  <Target Name="BeforeBuild">
-  </Target>
-  <Target Name="AfterBuild">
-  </Target>
-  -->
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{5624B7B5-B5A7-41D8-9F10-CC5611109619}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>MediaBrowser.WebDashboard</RootNamespace>
+    <AssemblyName>MediaBrowser.WebDashboard</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup>
+    <RunPostBuildEvent>Always</RunPostBuildEvent>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="ServiceStack, Version=3.9.37.0, Culture=neutral, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\packages\ServiceStack.3.9.37\lib\net35\ServiceStack.dll</HintPath>
+    </Reference>
+    <Reference Include="ServiceStack.Common, Version=3.9.37.0, Culture=neutral, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\packages\ServiceStack.Common.3.9.37\lib\net35\ServiceStack.Common.dll</HintPath>
+    </Reference>
+    <Reference Include="ServiceStack.Interfaces, Version=3.9.37.0, Culture=neutral, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\packages\ServiceStack.Common.3.9.37\lib\net35\ServiceStack.Interfaces.dll</HintPath>
+    </Reference>
+    <Reference Include="ServiceStack.OrmLite, Version=3.9.37.0, Culture=neutral, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\packages\ServiceStack.OrmLite.SqlServer.3.9.37\lib\ServiceStack.OrmLite.dll</HintPath>
+    </Reference>
+    <Reference Include="ServiceStack.OrmLite.SqlServer, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\packages\ServiceStack.OrmLite.SqlServer.3.9.37\lib\ServiceStack.OrmLite.SqlServer.dll</HintPath>
+    </Reference>
+    <Reference Include="ServiceStack.Redis, Version=3.9.37.0, Culture=neutral, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\packages\ServiceStack.Redis.3.9.37\lib\net35\ServiceStack.Redis.dll</HintPath>
+    </Reference>
+    <Reference Include="ServiceStack.ServiceInterface, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\packages\ServiceStack.3.9.37\lib\net35\ServiceStack.ServiceInterface.dll</HintPath>
+    </Reference>
+    <Reference Include="ServiceStack.Text, Version=3.9.37.0, Culture=neutral, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\packages\ServiceStack.Text.3.9.37\lib\net35\ServiceStack.Text.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.ComponentModel.Composition" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Runtime.Serialization" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="..\SharedVersion.cs">
+      <Link>Properties\SharedVersion.cs</Link>
+    </Compile>
+    <Compile Include="Api\DashboardInfo.cs" />
+    <Compile Include="Api\DashboardService.cs" />
+    <Compile Include="Api\DashboardInfoWebSocketListener.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\MediaBrowser.Common\MediaBrowser.Common.csproj">
+      <Project>{9142eefa-7570-41e1-bfcc-468bb571af2f}</Project>
+      <Name>MediaBrowser.Common</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\MediaBrowser.Controller\MediaBrowser.Controller.csproj">
+      <Project>{17e1f4e6-8abd-4fe5-9ecf-43d4b6087ba2}</Project>
+      <Name>MediaBrowser.Controller</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj">
+      <Project>{7eeeb4bb-f3e8-48fc-b4c5-70f0fff8329b}</Project>
+      <Name>MediaBrowser.Model</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\index.html" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\advanced.html" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\dashboard.html" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\scripts\Site.js" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\site.css" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\library.html" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\metadata.html" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\userProfiles.html" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\plugins.html" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\login.html" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\images\logindefault.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\uiSettings.html" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\editUser.html" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\favicon.ico" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\images\touchicon.png" />
+    <EmbeddedResource Include="Html\css\images\touchicon114.png" />
+    <EmbeddedResource Include="Html\css\images\touchicon72.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\images\iossplash.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\updatePassword.html" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\userImage.html" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\scripts\IndexPage.js" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\images\defaultCollectionImage.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\images\toolsWhite.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\images\currentUserDefaultWhite.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\images\rightArrow.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\images\userFlyoutDefault.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\scripts\MediaLibraryPage.js" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\scripts\DisplaySettingsPage.js" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\scripts\PluginsPage.js" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\scripts\MetadataConfigurationPage.js" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\scripts\LoginPage.js" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\scripts\UpdatePasswordPage.js" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\scripts\AdvancedConfigurationPage.js" />
+    <EmbeddedResource Include="Html\scripts\EditUserPage.js" />
+    <EmbeddedResource Include="Html\scripts\UserImagePage.js" />
+    <EmbeddedResource Include="Html\scripts\UserProfilesPage.js" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\advancedMetadata.html" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\scripts\AdvancedMetadataConfigurationPage.js" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\pluginUpdates.html" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\scripts\PluginUpdatesPage.js" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\addPlugin.html" />
+    <EmbeddedResource Include="Html\scripts\AddPluginPage.js" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\images\bg.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\pluginCatalog.html" />
+    <EmbeddedResource Include="Html\scripts\PluginCatalogPage.js" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\images\leftArrowBlack.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\images\leftArrowWhite.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\images\currentUserDefaultBlack.png" />
+    <EmbeddedResource Include="Html\css\images\toolsBlack.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\scheduledTasks.html" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\scripts\ScheduledTasksPage.js" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\scheduledTask.html" />
+    <EmbeddedResource Include="Html\scripts\ScheduledTaskPage.js" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\wizardStart.html" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\wizardFinish.html" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\wizardUser.html" />
+    <EmbeddedResource Include="Html\wizardLibrary.html" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\scripts\WizardStartPage.js" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\scripts\WizardUserPage.js" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\images\cloudNetwork.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\images\movieFolder.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\images\checkmarkblack.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\log.html" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\scripts\LogPage.js" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\metadataImages.html" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\scripts\MetadataImagesPage.js" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\scripts\DashboardPage.js" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\images\checkMarkGreen.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\images\clients\html5.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\images\clients\android.png" />
+    <EmbeddedResource Include="Html\css\images\clients\ios.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\images\clients\mb.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\images\clients\windowsrt.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\images\clients\windowsphone.png" />
+    <EmbeddedResource Include="Html\css\images\clients\win8.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\images\notifications\download.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\scripts\Extensions.js" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\support.html" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\scripts\SupporterPage.js" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\supporter.html" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\images\suppbadge.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\images\premiumflag.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\supporterKey.html" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\scripts\SupporterKeyPage.js" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\images\donatepp.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\font-awesome\faicons-v2.png" />
+    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\font-awesome\faicons.png" />
+    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\font-awesome\images\ajax-loader.png" />
+    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\font-awesome\images\icons-18-black-pack.png" />
+    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\font-awesome\images\icons-18-white-pack.png" />
+    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\font-awesome\images\icons-36-black-pack.png" />
+    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\font-awesome\images\icons-36-white-pack.png" />
+    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\font-awesome\index.html" />
+    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\font-awesome\jqm-icon-pack-3.0.0-fa.css" />
+    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\original\images\ajax-loader.gif" />
+    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\original\images\ajax-loader.png" />
+    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\original\images\icons-18-black-pack.png" />
+    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\original\images\icons-18-white-pack.png" />
+    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\original\images\icons-36-black-pack.png" />
+    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\original\images\icons-36-white-pack.png" />
+    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\original\index.html" />
+    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\original\jqm-icon-pack-2.0-original.css" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\font-awesome\font\fontawesome-webfont.eot" />
+    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\font-awesome\font\fontawesome-webfont.ttf" />
+    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\font-awesome\font\fontawesome-webfont.woff" />
+    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\font-awesome\font\FontAwesome.otf" />
+    <EmbeddedResource Include="Html\thirdparty\jqm-icon-pack-3.0\font-awesome\jqm-icon-pack-3.0.0-fa.scss" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\images\registerpp.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\images\home.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\images\notifications\done.png" />
+    <EmbeddedResource Include="Html\css\images\notifications\error.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\images\notifications\cancelled.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\images\notifications\info.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\itemDetails.html" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\scripts\ItemDetailPage.js" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Html\css\images\media\playCircle.png" />
+    <EmbeddedResource Include="Html\css\images\media\nextTrack.png" />
+    <EmbeddedResource Include="Html\css\images\media\pause.png" />
+    <EmbeddedResource Include="Html\css\images\media\play.png" />
+    <EmbeddedResource Include="Html\css\images\media\previousTrack.png" />
+    <EmbeddedResource Include="Html\css\images\media\stop.png" />
+    <EmbeddedResource Include="Html\css\images\itemDetails\videoDefault.png" />
+    <EmbeddedResource Include="Html\css\images\itemDetails\audioDefault.png" />
+    <EmbeddedResource Include="Html\css\images\itemDetails\gameDefault.png" />
+    <Content Include="Html\css\images\mblogoicon.png" />
+    <Content Include="Html\css\images\mblogotextblack.png" />
+    <Content Include="Html\css\images\mblogotextwhite.png" />
+    <Content Include="Html\css\images\stars.png" />
+    <EmbeddedResource Include="Html\scripts\MediaPlayer.js" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="packages.config" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <PropertyGroup>
+    <PostBuildEvent>xcopy "$(TargetPath)" "$(SolutionDir)\MediaBrowser.ServerApplication\CorePlugins\" /y</PostBuildEvent>
+  </PropertyGroup>
+  <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
 </Project>

+ 30 - 0
Nuget/MediaBrowser.ApiClient.nuspec

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
+    <metadata>
+        <id>MediaBrowser.ApiClient</id>
+        <version>3.0.0.0-beta</version>
+        <title>MediaBrowser.ApiInteraction</title>
+        <authors>Media Browser Team</authors>
+        <owners>Luke</owners>
+        <requireLicenseAcceptance>false</requireLicenseAcceptance>
+        <description>Description</description>
+        <copyright>Copyright ©  2012</copyright>
+        <dependencies>
+            <group>
+                <dependency id="protobuf-net" version="2.0.0.621" />
+            </group>
+            <group targetFramework=".NETFramework4.5">
+                <dependency id="ServiceStack.Text" version="3.9.37" />
+            </group>
+            <group targetFramework=".NETPortable0.0-net45+sl4+wp71+win8">
+                <dependency id="Newtonsoft.Json" version="4.5.11" />
+                <dependency id="Microsoft.Bcl.Async" version="1.0.14-rc" />
+                <dependency id="Microsoft.Net.Http" version="2.1.3-beta" />
+            </group>
+        </dependencies>
+    </metadata>
+    <files>
+        <file src="dlls\MediaBrowser.ApiInteraction.dll" target="lib\net45\MediaBrowser.ApiInteraction.dll" />
+        <file src="dlls\MediaBrowser.ApiInteraction.Portable.dll" target="lib\portable-net45+sl4+wp71+win8\MediaBrowser.ApiInteraction.Portable.dll" />
+    </files>
+</package>

+ 18 - 0
Nuget/MediaBrowser.Common.nuspec

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
+    <metadata>
+        <id>MediaBrowser.Common</id>
+        <version>1.0.1</version>
+        <title>MediaBrowser.Common</title>
+        <authors>Media Browser Team</authors>
+        <owners />
+        <projectUrl>https://github.com/MediaBrowser/MediaBrowser</projectUrl>
+        <requireLicenseAcceptance>false</requireLicenseAcceptance>
+        <description>Contains common model objects and interfaces used by all Media Browser solutions.</description>
+    </metadata>
+    <files>
+        <file src="dlls\MediaBrowser.Common.dll" target="lib\net45\MediaBrowser.Common.dll" />
+        <file src="dlls\MediaBrowser.Model.dll" target="lib\net45\MediaBrowser.Model.dll" />
+        <file src="dlls\MediaBrowser.Model.dll" target="lib\portable-net4+sl4+wp7+win8\MediaBrowser.Model.dll" />
+    </files>
+</package>

+ 0 - 1
Nuget/MediaBrowser.Server.Core.nupkg.REMOVED.git-id

@@ -1 +0,0 @@
-da3d30d634468465d8995ba6cb1c0872959b3e9c

+ 19 - 0
Nuget/MediaBrowser.Server.Core.nuspec

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
+    <metadata>
+        <id>MediaBrowser.Server.Core</id>
+        <version>1.0.0</version>
+        <title>Media Browser.Server.Core</title>
+        <authors>Media Browser Team</authors>
+        <owners />
+        <projectUrl>https://github.com/MediaBrowser/MediaBrowser</projectUrl>
+        <requireLicenseAcceptance>false</requireLicenseAcceptance>
+        <description>Contains core components required to build plugins for Media Browser Server.</description>
+        <dependencies>
+            <dependency id="MediaBrowser.Common" version="1.0.1" />
+        </dependencies>
+    </metadata>
+    <files>
+        <file src="dlls\MediaBrowser.Controller.dll" target="lib\net45\MediaBrowser.Controller.dll" />
+    </files>
+</package>

+ 20 - 0
Nuget/MediaBrowser.Theater.Core.nuspec

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
+    <metadata>
+        <id>MediaBrowser.Theater.Core</id>
+        <version>1.0.0</version>
+        <title>MediaBrowser.Theater.Core</title>
+        <authors>Media Browser Team</authors>
+        <owners />
+        <projectUrl>https://github.com/MediaBrowser/MediaBrowser.Theater</projectUrl>
+        <requireLicenseAcceptance>false</requireLicenseAcceptance>
+        <description>Contains components required to build plugins for Media Browser Theater.</description>
+        <dependencies>
+            <dependency id="MediaBrowser.Common" version="1.0.1" />
+        </dependencies>
+    </metadata>
+    <files>
+        <file src="dlls\MediaBrowser.UI.Controls.dll" target="lib\net45\MediaBrowser.UI.Controls.dll" />
+        <file src="dlls\MediaBrowser.UI.dll" target="lib\net45\MediaBrowser.UI.dll" />
+    </files>
+</package>

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä