diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-01-26 15:40:15 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-01-26 15:40:15 -0500 |
| commit | 1cd5e208713a057680b915c9136e0d4493611ed3 (patch) | |
| tree | 59e258ecd246dfb253c06cade5f0092af9874774 /Emby.Server.Core/IO/LibraryMonitor.cs | |
| parent | 0d0e4ad695f3657d7ca3eef1ed54fe8608a490a1 (diff) | |
| parent | 9ebf9162ab68fbf61a1dd5e7801eb9abe985762c (diff) | |
Merge pull request #2425 from MediaBrowser/beta
Beta
Diffstat (limited to 'Emby.Server.Core/IO/LibraryMonitor.cs')
| -rw-r--r-- | Emby.Server.Core/IO/LibraryMonitor.cs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Emby.Server.Core/IO/LibraryMonitor.cs b/Emby.Server.Core/IO/LibraryMonitor.cs index 6ed096f44..f0ecb9d89 100644 --- a/Emby.Server.Core/IO/LibraryMonitor.cs +++ b/Emby.Server.Core/IO/LibraryMonitor.cs @@ -87,7 +87,7 @@ namespace Emby.Server.Core.IO public bool IsPathLocked(string path) { var lockedPaths = _tempIgnoredPaths.Keys.ToList(); - return lockedPaths.Any(i => string.Equals(i, path, StringComparison.OrdinalIgnoreCase) || _fileSystem.ContainsSubPath(i, path)); + return lockedPaths.Any(i => _fileSystem.AreEqual(i, path) || _fileSystem.ContainsSubPath(i, path)); } public async void ReportFileSystemChangeComplete(string path, bool refreshPath) @@ -288,6 +288,13 @@ namespace Emby.Server.Core.IO { try { + if (!_fileSystem.DirectoryExists(path)) + { + // Seeing a crash in the mono runtime due to an exception being thrown on a different thread + Logger.Info("Skipping realtime monitor for {0} because the path does not exist", path); + return; + } + var newWatcher = new FileSystemWatcher(path, "*") { IncludeSubdirectories = true |
