Browse Source

fix windows restart

Luke Pulverenti 9 năm trước cách đây
mục cha
commit
71780d401f

+ 1 - 1
MediaBrowser.Server.Implementations/Library/LibraryManager.cs

@@ -1165,7 +1165,7 @@ namespace MediaBrowser.Server.Implementations.Library
         /// <returns>IEnumerable{VirtualFolderInfo}.</returns>
         /// <returns>IEnumerable{VirtualFolderInfo}.</returns>
         private IEnumerable<VirtualFolderInfo> GetView(string path)
         private IEnumerable<VirtualFolderInfo> GetView(string path)
         {
         {
-            return _fileSystem.GetFileSystemEntryPaths(path)
+            return _fileSystem.GetDirectoryPaths(path)
                 .Select(dir => new VirtualFolderInfo
                 .Select(dir => new VirtualFolderInfo
                 {
                 {
                     Name = Path.GetFileName(dir),
                     Name = Path.GetFileName(dir),

+ 5 - 1
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 + ")";
                 name += " (" + info.ProductionYear + ")";
             }
             }
+            else
+            {
+                name += " " + info.StartDate.ToString("yyyy-MM-dd");
+            }
 
 
             return name;
             return name;
         }
         }

+ 3 - 2
MediaBrowser.Server.Implementations/Session/SessionManager.cs

@@ -1322,8 +1322,9 @@ namespace MediaBrowser.Server.Implementations.Session
 
 
             if (existing.Items.Length > 0)
             if (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 AuthenticationInfo
             var newToken = new AuthenticationInfo

+ 3 - 7
MediaBrowser.ServerApplication/MainStartup.cs

@@ -513,23 +513,19 @@ namespace MediaBrowser.ServerApplication
 
 
             if (!_isRunningAsService)
             if (!_isRunningAsService)
             {
             {
-                _logger.Info("Hiding server notify icon");
-                _serverNotifyIcon.Visible = false;
+                //_logger.Info("Hiding server notify icon");
+                //_serverNotifyIcon.Visible = false;
 
 
                 _logger.Info("Starting new instance");
                 _logger.Info("Starting new instance");
                 //Application.Restart();
                 //Application.Restart();
                 Process.Start(_appHost.ServerConfigurationManager.ApplicationPaths.ApplicationPath);
                 Process.Start(_appHost.ServerConfigurationManager.ApplicationPaths.ApplicationPath);
 
 
-                _logger.Info("Calling Environment.Exit");
-                Environment.Exit(0);
+                ShutdownWindowsApplication();
             }
             }
         }
         }
 
 
         private static void ShutdownWindowsApplication()
         private static void ShutdownWindowsApplication()
         {
         {
-            _logger.Info("Hiding server notify icon");
-            _serverNotifyIcon.Visible = false;
-
             _logger.Info("Calling Application.Exit");
             _logger.Info("Calling Application.Exit");
             Application.Exit();
             Application.Exit();
 
 

+ 13 - 0
MediaBrowser.ServerApplication/ServerNotifyIcon.cs

@@ -140,6 +140,19 @@ namespace MediaBrowser.ServerApplication
             }
             }
 
 
             notifyIcon1.DoubleClick += notifyIcon1_DoubleClick;
             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)
         void notifyIcon1_DoubleClick(object sender, EventArgs e)

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

@@ -191,6 +191,9 @@
     <Content Include="dashboard-ui\cordova\fileupload.js">
     <Content Include="dashboard-ui\cordova\fileupload.js">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
     </Content>
+    <Content Include="dashboard-ui\cordova\ios\backgroundfetch.js">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
     <Content Include="dashboard-ui\cordova\ios\vlcplayer.js">
     <Content Include="dashboard-ui\cordova\ios\vlcplayer.js">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
     </Content>