The Free Software Media System - Server Backend & API
fix windows restart
Luke Pulverenti71780d401f95
diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.csindex 26961c4904..966c1e0378 100644--- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs+++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs@@ -1165,7 +1165,7 @@ namespace MediaBrowser.Server.Implementations.Library/// <returns>IEnumerable{VirtualFolderInfo}.</returns>private IEnumerable<VirtualFolderInfo> GetView(string path){- return _fileSystem.GetFileSystemEntryPaths(path)+ return _fileSystem.GetDirectoryPaths(path).Select(dir => new VirtualFolderInfo{Name = Path.GetFileName(dir),diff --git a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/RecordingHelper.cs b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/RecordingHelper.csindex 5b83d63b17..3ee808bb51 100644--- a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/RecordingHelper.cs+++ b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/RecordingHelper.cs@@ -67,10 +67,14 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV}}- else if (info.ProductionYear != null)+ else if (info.IsMovie && info.ProductionYear != null){name += " (" + info.ProductionYear + ")";}+ else+ {+ name += " " + info.StartDate.ToString("yyyy-MM-dd");+ }return name;}diff --git a/MediaBrowser.Server.Implementations/Session/SessionManager.cs b/MediaBrowser.Server.Implementations/Session/SessionManager.csindex 70a4cb4392..d9c3ed7a6d 100644--- a/MediaBrowser.Server.Implementations/Session/SessionManager.cs+++ b/MediaBrowser.Server.Implementations/Session/SessionManager.cs@@ -1322,8 +1322,9 @@ namespace MediaBrowser.Server.Implementations.Sessionif (existing.Items.Length > 0){- _logger.Debug("Reissuing access token");- return existing.Items[0].AccessToken;+ var token = existing.Items[0].AccessToken;+ _logger.Debug("Reissuing access token: " + token);+ return token;}var newToken = new AuthenticationInfodiff --git a/MediaBrowser.ServerApplication/MainStartup.cs b/MediaBrowser.ServerApplication/MainStartup.csindex 968172bc3a..80b7d230ab 100644--- a/MediaBrowser.ServerApplication/MainStartup.cs+++ b/MediaBrowser.ServerApplication/MainStartup.cs@@ -513,23 +513,19 @@ namespace MediaBrowser.ServerApplicationif (!_isRunningAsService){- _logger.Info("Hiding server notify icon");- _serverNotifyIcon.Visible = false;+ //_logger.Info("Hiding server notify icon");+ //_serverNotifyIcon.Visible = false;_logger.Info("Starting new instance");//Application.Restart();Process.Start(_appHost.ServerConfigurationManager.ApplicationPaths.ApplicationPath);- _logger.Info("Calling Environment.Exit");- Environment.Exit(0);+ ShutdownWindowsApplication();}}private static void ShutdownWindowsApplication(){- _logger.Info("Hiding server notify icon");- _serverNotifyIcon.Visible = false;-_logger.Info("Calling Application.Exit");Application.Exit();diff --git a/MediaBrowser.ServerApplication/ServerNotifyIcon.cs b/MediaBrowser.ServerApplication/ServerNotifyIcon.csindex 3501c8c278..dd9e5d5f00 100644--- a/MediaBrowser.ServerApplication/ServerNotifyIcon.cs+++ b/MediaBrowser.ServerApplication/ServerNotifyIcon.cs@@ -140,6 +140,19 @@ namespace MediaBrowser.ServerApplication}notifyIcon1.DoubleClick += notifyIcon1_DoubleClick;+ Application.ApplicationExit += Application_ApplicationExit;+ }++ void Application_ApplicationExit(object sender, EventArgs e)+ {+ try+ {+ notifyIcon1.Visible = false;+ }+ catch+ {++ }}void notifyIcon1_DoubleClick(object sender, EventArgs e)diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csprojindex 23e13da07c..dfa58ad04f 100644--- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj+++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj@@ -191,6 +191,9 @@<Content Include="dashboard-ui\cordova\fileupload.js"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>+ <Content Include="dashboard-ui\cordova\ios\backgroundfetch.js">+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>+ </Content><Content Include="dashboard-ui\cordova\ios\vlcplayer.js"><CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory></Content>