mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-17 06:23:03 +03:00
Fix slow local image validation (#990)
* Check for local image directory existence to avoid tons of exceptions
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user