diff options
| author | dkanada <dkanada@users.noreply.github.com> | 2019-05-16 16:45:56 -0700 |
|---|---|---|
| committer | dkanada <dkanada@users.noreply.github.com> | 2019-05-16 16:45:56 -0700 |
| commit | 4a9b349c0463b46a3208b949f75d951f092aa735 (patch) | |
| tree | 5df1f53dfec9b69dda2aeb5418289351b34cc5b2 /Emby.Server.Implementations/IO/ManagedFileSystem.cs | |
| parent | 71f81c5fb0e4f9bcf1242552e0d6df7a88593d3e (diff) | |
only return useful drives
Diffstat (limited to 'Emby.Server.Implementations/IO/ManagedFileSystem.cs')
| -rw-r--r-- | Emby.Server.Implementations/IO/ManagedFileSystem.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/IO/ManagedFileSystem.cs b/Emby.Server.Implementations/IO/ManagedFileSystem.cs index 0dea5041a..f0bea0455 100644 --- a/Emby.Server.Implementations/IO/ManagedFileSystem.cs +++ b/Emby.Server.Implementations/IO/ManagedFileSystem.cs @@ -667,13 +667,13 @@ namespace Emby.Server.Implementations.IO public virtual List<FileSystemMetadata> GetDrives() { - // Only include drives in the ready state or this method could end up being very slow, waiting for drives to timeout - return DriveInfo.GetDrives().Where(d => d.IsReady).Select(d => new FileSystemMetadata + // check for ready state to avoid waiting for drives to timeout + // some drives on linux have no actual size or are used for other purposes + return DriveInfo.GetDrives().Where(d => d.IsReady && d.TotalSize != 0 && d.DriveType != DriveType.Ram).Select(d => new FileSystemMetadata { Name = d.Name, FullName = d.RootDirectory.FullName, IsDirectory = true - }).ToList(); } |
