mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-17 15:02:34 +02:00
Fixed: Prevent getting disk space from returning no information when it partially fails
(cherry picked from commit 2c65e4fa41418157d0d27b34c3bab80158cff219)
This commit is contained in:
parent
cea0c5033a
commit
a78693a2f7
@ -168,14 +168,32 @@ public override void CopyPermissions(string sourcePath, string targetPath)
|
|||||||
|
|
||||||
protected override List<IMount> GetAllMounts()
|
protected override List<IMount> GetAllMounts()
|
||||||
{
|
{
|
||||||
return _procMountProvider.GetMounts()
|
var mounts = new List<IMount>();
|
||||||
.Concat(GetDriveInfoMounts()
|
|
||||||
.Select(d => new DriveInfoMount(d, FindDriveType.Find(d.DriveFormat)))
|
try
|
||||||
.Where(d => d.DriveType == DriveType.Fixed ||
|
{
|
||||||
d.DriveType == DriveType.Network ||
|
mounts.AddRange(_procMountProvider.GetMounts());
|
||||||
d.DriveType == DriveType.Removable))
|
}
|
||||||
.DistinctBy(v => v.RootDirectory)
|
catch (Exception e)
|
||||||
.ToList();
|
{
|
||||||
|
_logger.Warn(e, $"Unable to get mounts: {e.Message}");
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
mounts.AddRange(GetDriveInfoMounts()
|
||||||
|
.Select(d => new DriveInfoMount(d, FindDriveType.Find(d.DriveFormat)))
|
||||||
|
.Where(d => d.DriveType == DriveType.Fixed ||
|
||||||
|
d.DriveType == DriveType.Network ||
|
||||||
|
d.DriveType == DriveType.Removable));
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
_logger.Warn(e, $"Unable to get drive mounts: {e.Message}");
|
||||||
|
}
|
||||||
|
|
||||||
|
return mounts.DistinctBy(v => v.RootDirectory)
|
||||||
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool IsSpecialMount(IMount mount)
|
protected override bool IsSpecialMount(IMount mount)
|
||||||
|
Loading…
Reference in New Issue
Block a user