From ffb935700cc2d9ac47a81e43cf2187ff8c78957a Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 27 Apr 2017 14:11:56 -0400 Subject: [PATCH 1/4] update mono unhandled exception handler --- .../Logging/UnhandledExceptionWriter.cs | 6 ++++-- MediaBrowser.Server.Mono/Program.cs | 7 ++++++- MediaBrowser.Server.Mono/app.config | 2 ++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Emby.Server.Implementations/Logging/UnhandledExceptionWriter.cs b/Emby.Server.Implementations/Logging/UnhandledExceptionWriter.cs index 5183f3a0b..6e96d83fd 100644 --- a/Emby.Server.Implementations/Logging/UnhandledExceptionWriter.cs +++ b/Emby.Server.Implementations/Logging/UnhandledExceptionWriter.cs @@ -35,9 +35,11 @@ namespace Emby.Server.Implementations.Logging // Write to console just in case file logging fails _console.WriteLine("UnhandledException"); - _console.WriteLine(builder.ToString()); - _fileSystem.WriteAllText(path, builder.ToString()); + var logMessage = builder.ToString(); + _console.WriteLine(logMessage); + + _fileSystem.WriteAllText(path, logMessage); } } } diff --git a/MediaBrowser.Server.Mono/Program.cs b/MediaBrowser.Server.Mono/Program.cs index 66851f7e9..dcd2dcaa6 100644 --- a/MediaBrowser.Server.Mono/Program.cs +++ b/MediaBrowser.Server.Mono/Program.cs @@ -258,7 +258,12 @@ namespace MediaBrowser.Server.Mono if (!Debugger.IsAttached) { - Environment.Exit(System.Runtime.InteropServices.Marshal.GetHRForException(exception)); + var message = LogHelper.GetLogMessage(exception).ToString(); + + if (message.IndexOf("InotifyWatcher", StringComparison.OrdinalIgnoreCase) == -1) + { + Environment.Exit(System.Runtime.InteropServices.Marshal.GetHRForException(exception)); + } } } diff --git a/MediaBrowser.Server.Mono/app.config b/MediaBrowser.Server.Mono/app.config index 07c113f3e..8f21d4a67 100644 --- a/MediaBrowser.Server.Mono/app.config +++ b/MediaBrowser.Server.Mono/app.config @@ -11,6 +11,8 @@ + + From da39d9a5bf9656f35501c5e11982240192ce34a2 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 27 Apr 2017 14:12:44 -0400 Subject: [PATCH 2/4] update folder queries --- .../FileOrganization/EpisodeFileOrganizer.cs | 2 +- .../Library/MusicManager.cs | 85 +++++++------------ .../Entities/Audio/MusicGenre.cs | 2 +- MediaBrowser.Controller/Entities/GameGenre.cs | 2 +- MediaBrowser.Controller/Entities/Genre.cs | 2 +- .../Entities/Movies/BoxSet.cs | 4 +- .../Entities/UserViewBuilder.cs | 29 ++----- MediaBrowser.Controller/Playlists/Playlist.cs | 29 +++---- .../Encoder/EncodingJob.cs | 2 - .../Music/AlbumImageFromSongProvider.cs | 3 +- .../TV/DummySeasonProvider.cs | 4 +- .../TV/MissingEpisodeProvider.cs | 19 +++-- 12 files changed, 69 insertions(+), 114 deletions(-) diff --git a/Emby.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs b/Emby.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs index 0a9c67285..7b64c582a 100644 --- a/Emby.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs +++ b/Emby.Server.Implementations/FileOrganization/EpisodeFileOrganizer.cs @@ -470,7 +470,7 @@ namespace Emby.Server.Implementations.FileOrganization return new List(); } - var episodePaths = series.GetRecursiveChildren() + var episodePaths = series.GetRecursiveChildren(i => i is Episode) .OfType() .Where(i => { diff --git a/Emby.Server.Implementations/Library/MusicManager.cs b/Emby.Server.Implementations/Library/MusicManager.cs index 9d07837c6..b15c01125 100644 --- a/Emby.Server.Implementations/Library/MusicManager.cs +++ b/Emby.Server.Implementations/Library/MusicManager.cs @@ -5,6 +5,7 @@ using MediaBrowser.Controller.Playlists; using System; using System.Collections.Generic; using System.Linq; +using MediaBrowser.Model.Querying; namespace Emby.Server.Implementations.Library { @@ -27,53 +28,17 @@ namespace Emby.Server.Implementations.Library return list.Concat(GetInstantMixFromGenres(item.Genres, user)); } - public IEnumerable