The Free Software Media System - Server Backend & API
update logging levels
Luke Pulverenti4ad96e4ff575
diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.csindex 4eecaacedb..afec3d03bd 100644--- a/Emby.Drawing/ImageProcessor.cs+++ b/Emby.Drawing/ImageProcessor.cs@@ -774,11 +774,11 @@ namespace Emby.Drawingtry{- _logger.Debug("Creating image collage and saving to {0}", options.OutputPath);+ _logger.Info("Creating image collage and saving to {0}", options.OutputPath);_imageEncoder.CreateImageCollage(options);- _logger.Debug("Completed creation of image collage and saved to {0}", options.OutputPath);+ _logger.Info("Completed creation of image collage and saved to {0}", options.OutputPath);}finally{diff --git a/MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs b/MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.csindex f2b235bd9d..52612c4c11 100644--- a/MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs+++ b/MediaBrowser.Common.Implementations/ScheduledTasks/ScheduledTaskWorker.cs@@ -626,7 +626,7 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks{try{- Logger.Debug(Name + ": Cancelling");+ Logger.Info(Name + ": Cancelling");token.Cancel();}catch (Exception ex)@@ -639,16 +639,16 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks{try{- Logger.Debug(Name + ": Waiting on Task");+ Logger.Info(Name + ": Waiting on Task");var exited = Task.WaitAll(new[] { task }, 2000);if (exited){- Logger.Debug(Name + ": Task exited");+ Logger.Info(Name + ": Task exited");}else{- Logger.Debug(Name + ": Timed out waiting for task to stop");+ Logger.Info(Name + ": Timed out waiting for task to stop");}}catch (Exception ex)diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.csindex ca760e1305..25a8e4876d 100644--- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs+++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs@@ -149,7 +149,11 @@ namespace MediaBrowser.MediaEncoding.Probingif (!string.IsNullOrEmpty(streamInfo.sample_rate)){- stream.SampleRate = int.Parse(streamInfo.sample_rate, _usCulture);+ int value;+ if (int.TryParse(streamInfo.sample_rate, NumberStyles.Any, _usCulture, out value))+ {+ stream.SampleRate = value;+ }}stream.ChannelLayout = ParseChannelLayout(streamInfo.channel_layout);@@ -190,12 +194,21 @@ namespace MediaBrowser.MediaEncoding.Probingif (!string.IsNullOrEmpty(streamInfo.bit_rate)){- bitrate = int.Parse(streamInfo.bit_rate, _usCulture);+ int value;+ if (int.TryParse(streamInfo.bit_rate, NumberStyles.Any, _usCulture, out value))+ {+ bitrate = value;+ }}- else if (formatInfo != null && !string.IsNullOrEmpty(formatInfo.bit_rate) && stream.Type == MediaStreamType.Video)++ if (bitrate == 0 && formatInfo != null && !string.IsNullOrEmpty(formatInfo.bit_rate) && stream.Type == MediaStreamType.Video){// If the stream info doesn't have a bitrate get the value from the media format info- bitrate = int.Parse(formatInfo.bit_rate, _usCulture);+ int value;+ if (int.TryParse(formatInfo.bit_rate, NumberStyles.Any, _usCulture, out value))+ {+ bitrate = value;+ }}if (bitrate > 0)@@ -518,23 +531,23 @@ namespace MediaBrowser.MediaEncoding.Probing// These support mulitple values, but for now we only store the first.var mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Album Artist Id"));- if(mb == null) mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MUSICBRAINZ_ALBUMARTISTID"));+ if (mb == null) mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MUSICBRAINZ_ALBUMARTISTID"));audio.SetProviderId(MetadataProviders.MusicBrainzAlbumArtist, mb);-+mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Artist Id"));- if(mb == null) mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MUSICBRAINZ_ARTISTID"));+ if (mb == null) mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MUSICBRAINZ_ARTISTID"));audio.SetProviderId(MetadataProviders.MusicBrainzArtist, mb);mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Album Id"));- if(mb == null) mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MUSICBRAINZ_ALBUMID"));+ if (mb == null) mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MUSICBRAINZ_ALBUMID"));audio.SetProviderId(MetadataProviders.MusicBrainzAlbum, mb);-+mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Release Group Id"));- if(mb == null) mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MUSICBRAINZ_RELEASEGROUPID"));+ if (mb == null) mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MUSICBRAINZ_RELEASEGROUPID"));audio.SetProviderId(MetadataProviders.MusicBrainzReleaseGroup, mb);mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Release Track Id"));- if(mb == null) mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MUSICBRAINZ_RELEASETRACKID"));+ if (mb == null) mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MUSICBRAINZ_RELEASETRACKID"));audio.SetProviderId(MetadataProviders.MusicBrainzTrack, mb);}diff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.csindex 998937d601..aa8efbde22 100644--- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs+++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs@@ -411,7 +411,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles}};- _logger.Debug("{0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments);+ _logger.Info("{0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments);var logFilePath = Path.Combine(_appPaths.LogDirectoryPath, "ffmpeg-sub-convert-" + Guid.NewGuid() + ".txt");_fileSystem.CreateDirectory(Path.GetDirectoryName(logFilePath));diff --git a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.csindex 7d7d37c83e..d2aeead5c9 100644--- a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs+++ b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs@@ -734,7 +734,7 @@ namespace MediaBrowser.Providers.MediaInforeturn minSizeVobs.Count == 0 ? vobs.Select(i => i.FullName) : minSizeVobs.Select(i => i.FullName);}- _logger.Debug("Could not determine vob file list for {0} using DvdLib. Will scan using file sizes.", video.Path);+ _logger.Info("Could not determine vob file list for {0} using DvdLib. Will scan using file sizes.", video.Path);}var files = allVobsdiff --git a/MediaBrowser.Providers/MediaInfo/VideoImageProvider.cs b/MediaBrowser.Providers/MediaInfo/VideoImageProvider.csindex 991f47f802..6b035ed819 100644--- a/MediaBrowser.Providers/MediaInfo/VideoImageProvider.cs+++ b/MediaBrowser.Providers/MediaInfo/VideoImageProvider.cs@@ -81,7 +81,7 @@ namespace MediaBrowser.Providers.MediaInfo// Can't extract if we didn't find a video stream in the fileif (!video.DefaultVideoStreamIndex.HasValue){- _logger.Debug("Skipping image extraction due to missing DefaultVideoStreamIndex for {0}.", video.Path ?? string.Empty);+ _logger.Info("Skipping image extraction due to missing DefaultVideoStreamIndex for {0}.", video.Path ?? string.Empty);return Task.FromResult(new DynamicImageResponse { HasImage = false });}diff --git a/MediaBrowser.Server.Implementations/Channels/ChannelPostScanTask.cs b/MediaBrowser.Server.Implementations/Channels/ChannelPostScanTask.csindex 976fa56153..0321af66b3 100644--- a/MediaBrowser.Server.Implementations/Channels/ChannelPostScanTask.cs+++ b/MediaBrowser.Server.Implementations/Channels/ChannelPostScanTask.cs@@ -143,7 +143,7 @@ namespace MediaBrowser.Server.Implementations.Channelsprivate async Task CleanChannel(Guid id, CancellationToken cancellationToken){- _logger.Debug("Cleaning channel {0} from database", id);+ _logger.Info("Cleaning channel {0} from database", id);// Delete all channel itemsvar allIds = _libraryManager.GetItemIds(new InternalItemsQuerydiff --git a/MediaBrowser.Server.Implementations/HttpServer/LoggerUtils.cs b/MediaBrowser.Server.Implementations/HttpServer/LoggerUtils.csindex 5558c24d73..f038591aa7 100644--- a/MediaBrowser.Server.Implementations/HttpServer/LoggerUtils.cs+++ b/MediaBrowser.Server.Implementations/HttpServer/LoggerUtils.cs@@ -27,7 +27,7 @@ namespace MediaBrowser.Server.Implementations.HttpServervar msg = "HTTP Response " + statusCode + " to " + endPoint + responseTime;- logger.LogMultiline(msg, LogSeverity.Debug, log);+ logger.LogMultiline(msg, LogSeverity.Info, log);}}}diff --git a/MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs b/MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.csindex b4da407026..f6b14fcab3 100644--- a/MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs+++ b/MediaBrowser.Server.Implementations/HttpServer/Security/AuthService.cs@@ -220,7 +220,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Security{if (string.IsNullOrWhiteSpace(token)){- throw new SecurityException("Access token is invalid or expired.");+ throw new SecurityException("Access token is required.");}var info = GetTokenInfo(request);diff --git a/MediaBrowser.Server.Implementations/HttpServer/Security/AuthorizationContext.cs b/MediaBrowser.Server.Implementations/HttpServer/Security/AuthorizationContext.csindex ae5ce796ea..509a00ff9b 100644--- a/MediaBrowser.Server.Implementations/HttpServer/Security/AuthorizationContext.cs+++ b/MediaBrowser.Server.Implementations/HttpServer/Security/AuthorizationContext.cs@@ -62,8 +62,12 @@ namespace MediaBrowser.Server.Implementations.HttpServer.Securityauth.TryGetValue("Version", out version);}- var token = httpReq.Headers["X-MediaBrowser-Token"];+ var token = httpReq.Headers["X-Emby-Token"];+ if (string.IsNullOrWhiteSpace(token))+ {+ token = httpReq.Headers["X-MediaBrowser-Token"];+ }if (string.IsNullOrWhiteSpace(token)){token = httpReq.QueryString["api_key"];diff --git a/MediaBrowser.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.cs b/MediaBrowser.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.csindex fdb27d40db..f8178c1155 100644--- a/MediaBrowser.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.cs+++ b/MediaBrowser.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpListener.cs@@ -191,7 +191,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer.SocketSharpvar type = request.IsWebSocketRequest ? "Web Socket" : "HTTP " + request.HttpMethod;- logger.LogMultiline(type + " " + request.Url, LogSeverity.Debug, log);+ logger.LogMultiline(type + " " + request.Url, LogSeverity.Info, log);}private void HandleError(Exception ex, HttpListenerContext context)diff --git a/MediaBrowser.Server.Implementations/Session/SessionManager.cs b/MediaBrowser.Server.Implementations/Session/SessionManager.csindex d164874dc9..8d32734217 100644--- a/MediaBrowser.Server.Implementations/Session/SessionManager.cs+++ b/MediaBrowser.Server.Implementations/Session/SessionManager.cs@@ -1324,7 +1324,7 @@ namespace MediaBrowser.Server.Implementations.Sessionif (existing.Items.Length > 0){var token = existing.Items[0].AccessToken;- _logger.Debug("Reissuing access token: " + token);+ _logger.Info("Reissuing access token: " + token);return token;}@@ -1340,7 +1340,7 @@ namespace MediaBrowser.Server.Implementations.SessionAccessToken = Guid.NewGuid().ToString("N")};- _logger.Debug("Creating new access token for user {0}", userId);+ _logger.Info("Creating new access token for user {0}", userId);await _authRepo.Create(newToken, CancellationToken.None).ConfigureAwait(false);return newToken.AccessToken;@@ -1353,6 +1353,8 @@ namespace MediaBrowser.Server.Implementations.Sessionthrow new ArgumentNullException("accessToken");}+ _logger.Info("Logging out access token {0}", accessToken);+var existing = _authRepo.Get(new AuthenticationInfoQuery{Limit = 1,diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.csindex f1833f4fc0..f24a3541b9 100644--- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs+++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs@@ -502,7 +502,7 @@ namespace MediaBrowser.Server.Startup.CommonLiveTvManager = new LiveTvManager(this, ServerConfigurationManager, Logger, ItemRepository, ImageProcessor, UserDataManager, DtoService, UserManager, LibraryManager, TaskManager, LocalizationManager, JsonSerializer, ProviderManager, FileSystemManager);RegisterSingleInstance(LiveTvManager);- UserViewManager = new UserViewManager(LibraryManager, LocalizationManager, UserManager, ChannelManager, LiveTvManager, PlaylistManager, CollectionManager, ServerConfigurationManager);+ UserViewManager = new UserViewManager(LibraryManager, LocalizationManager, UserManager, ChannelManager, LiveTvManager, ServerConfigurationManager);RegisterSingleInstance(UserViewManager);var contentDirectory = new ContentDirectory(dlnaManager, UserDataManager, ImageProcessor, LibraryManager, ServerConfigurationManager, UserManager, LogManager.GetLogger("UpnpContentDirectory"), HttpClient, LocalizationManager, ChannelManager, MediaSourceManager);@@ -944,7 +944,7 @@ namespace MediaBrowser.Server.Startup.CommonLogger.ErrorException("Error sending server restart notification", ex);}- Logger.Debug("Calling NativeApp.Restart");+ Logger.Info("Calling NativeApp.Restart");NativeApp.Restart(_startupOptions);}