Merge pull request #6792 from Bond-009/authex

Fix UnauthorizedAccessException in GetDrives
This commit is contained in:
Claus Vium 2021-11-07 19:36:09 +01:00 committed by GitHub
commit 195831ad4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -580,7 +580,11 @@ namespace Emby.Server.Implementations.IO
{
// 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)
return DriveInfo.GetDrives()
.Where(
d => (d.DriveType == DriveType.Fixed || d.DriveType == DriveType.Network || d.DriveType == DriveType.Removable)
&& d.IsReady
&& d.TotalSize != 0)
.Select(d => new FileSystemMetadata
{
Name = d.Name,