diff options
| author | Claus Vium <cvium@users.noreply.github.com> | 2019-02-24 16:16:53 +0100 |
|---|---|---|
| committer | Bond-009 <bond.009@outlook.com> | 2019-02-24 10:16:53 -0500 |
| commit | 2e9a3d45c2a03f930856d038867a7caff01f208f (patch) | |
| tree | d9a1cbe7b2e7ea9fb8b33eac926052cb52d5f9c9 /MediaBrowser.LocalMetadata/Images/LocalImageProvider.cs | |
| parent | e281c79d6fffd4c0c2700d0417b1933e7c5d3c33 (diff) | |
Fix slow local image validation (#990)
* Check for local image directory existence to avoid tons of exceptions
Diffstat (limited to 'MediaBrowser.LocalMetadata/Images/LocalImageProvider.cs')
| -rw-r--r-- | MediaBrowser.LocalMetadata/Images/LocalImageProvider.cs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/MediaBrowser.LocalMetadata/Images/LocalImageProvider.cs b/MediaBrowser.LocalMetadata/Images/LocalImageProvider.cs index 1a7654bfd..7c330ad86 100644 --- a/MediaBrowser.LocalMetadata/Images/LocalImageProvider.cs +++ b/MediaBrowser.LocalMetadata/Images/LocalImageProvider.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Globalization; +using System.IO; using System.Linq; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.Audio; @@ -65,6 +66,12 @@ namespace MediaBrowser.LocalMetadata.Images var path = item.ContainingFolderPath; + // Exit if the cache dir does not exist, alternative solution is to create it, but that's a lot of empty dirs... + if (!Directory.Exists(path)) + { + return Array.Empty<FileSystemMetadata>(); + } + if (includeDirectories) { return directoryService.GetFileSystemEntries(path) |
