The Free Software Media System - Server Backend & API
update logging
Luke Pulverenti325066f7edb5
diff --git a/Emby.Common.Implementations/BaseApplicationHost.cs b/Emby.Common.Implementations/BaseApplicationHost.csindex 02d7cb31fd..9c9e14ec6b 100644--- a/Emby.Common.Implementations/BaseApplicationHost.cs+++ b/Emby.Common.Implementations/BaseApplicationHost.cs@@ -795,6 +795,8 @@ return null;/// </summary>public void NotifyPendingRestart(){+ Logger.Info("App needs to be restarted.");+var changed = !HasPendingRestart;HasPendingRestart = true;diff --git a/Emby.Server.Core/ApplicationHost.cs b/Emby.Server.Core/ApplicationHost.csindex 3590ade401..215ac84924 100644--- a/Emby.Server.Core/ApplicationHost.cs+++ b/Emby.Server.Core/ApplicationHost.cs@@ -1083,6 +1083,8 @@ namespace Emby.Server.Coreif (requiresRestart){+ Logger.Info("App needs to be restarted due to configuration change.");+NotifyPendingRestart();}}@@ -1204,7 +1206,8 @@ namespace Emby.Server.Corevar exclude = new[]{"mbplus.dll",- "mbintros.dll"+ "mbintros.dll",+ "embytv.dll"};return !exclude.Contains(filename ?? string.Empty, StringComparer.OrdinalIgnoreCase);diff --git a/Emby.Server.Implementations/EntryPoints/AutomaticRestartEntryPoint.cs b/Emby.Server.Implementations/EntryPoints/AutomaticRestartEntryPoint.csindex 38708648fe..561f5ee12e 100644--- a/Emby.Server.Implementations/EntryPoints/AutomaticRestartEntryPoint.cs+++ b/Emby.Server.Implementations/EntryPoints/AutomaticRestartEntryPoint.cs@@ -51,7 +51,7 @@ namespace Emby.Server.Implementations.EntryPointsif (_appHost.HasPendingRestart){- _timer = _timerFactory.Create(TimerCallback, null, TimeSpan.FromMinutes(10), TimeSpan.FromMinutes(10));+ _timer = _timerFactory.Create(TimerCallback, null, TimeSpan.FromMinutes(15), TimeSpan.FromMinutes(15));}}@@ -65,6 +65,8 @@ namespace Emby.Server.Implementations.EntryPoints{DisposeTimer();+ _logger.Info("Automatically restarting the system because it is idle and a restart is required.");+try{_appHost.Restart();diff --git a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs b/Emby.Server.Implementations/HttpServer/HttpListenerHost.csindex 0e1f5a5517..83885ee2ee 100644--- a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs+++ b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs@@ -228,11 +228,14 @@ namespace Emby.Server.Implementations.HttpServer}}- private void ErrorHandler(Exception ex, IRequest httpReq)+ private void ErrorHandler(Exception ex, IRequest httpReq, bool logException = true){try{- _logger.ErrorException("Error processing request", ex);+ if (logException)+ {+ _logger.ErrorException("Error processing request", ex);+ }var httpRes = httpReq.Response;@@ -529,6 +532,10 @@ namespace Emby.Server.Implementations.HttpServerErrorHandler(new FileNotFoundException(), httpReq);}}+ catch (OperationCanceledException ex)+ {+ ErrorHandler(ex, httpReq, false);+ }catch (Exception ex){ErrorHandler(ex, httpReq);diff --git a/Emby.Server.Implementations/HttpServer/IHttpListener.cs b/Emby.Server.Implementations/HttpServer/IHttpListener.csindex 9f96a8e49d..18df5682d7 100644--- a/Emby.Server.Implementations/HttpServer/IHttpListener.cs+++ b/Emby.Server.Implementations/HttpServer/IHttpListener.cs@@ -12,7 +12,7 @@ namespace Emby.Server.Implementations.HttpServer/// Gets or sets the error handler./// </summary>/// <value>The error handler.</value>- Action<Exception, IRequest> ErrorHandler { get; set; }+ Action<Exception, IRequest, bool> ErrorHandler { get; set; }/// <summary>/// Gets or sets the request handler.diff --git a/Emby.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.cs b/Emby.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.csindex 4606d0e316..652fc4f837 100644--- a/Emby.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.cs+++ b/Emby.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.cs@@ -44,7 +44,7 @@ namespace Emby.Server.Implementations.HttpServer.SocketSharp_httpRequestFactory = httpRequestFactory;}- public Action<Exception, IRequest> ErrorHandler { get; set; }+ public Action<Exception, IRequest, bool> ErrorHandler { get; set; }public Func<IHttpRequest, Uri, Task> RequestHandler { get; set; }public Action<WebSocketConnectingEventArgs> WebSocketConnecting { get; set; }@@ -102,7 +102,7 @@ namespace Emby.Server.Implementations.HttpServer.SocketSharp_logger.ErrorException("Error processing request", ex);httpReq = httpReq ?? GetRequest(context);- ErrorHandler(ex, httpReq);+ ErrorHandler(ex, httpReq, true);return Task.FromResult(true);}diff --git a/MediaBrowser.Providers/TV/MissingEpisodeProvider.cs b/MediaBrowser.Providers/TV/MissingEpisodeProvider.csindex 5385125577..22e7e753ca 100644--- a/MediaBrowser.Providers/TV/MissingEpisodeProvider.cs+++ b/MediaBrowser.Providers/TV/MissingEpisodeProvider.cs@@ -87,6 +87,12 @@ namespace MediaBrowser.Providers.TVvar seriesDataPath = TvdbSeriesProvider.GetSeriesDataPath(_config.ApplicationPaths, seriesProviderIds);+ // Doesn't have required provider id's+ if (string.IsNullOrWhiteSpace(seriesDataPath))+ {+ return;+ }+var episodeFiles = _fileSystem.GetFilePaths(seriesDataPath).Where(i => string.Equals(Path.GetExtension(i), ".xml", StringComparison.OrdinalIgnoreCase)).Select(Path.GetFileNameWithoutExtension)