mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-05 02:22:31 +01:00
Added: Include APFS disks in disk space calculation.
This commit is contained in:
parent
f36716135b
commit
948af901da
@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@ -116,21 +116,14 @@ public override void SetPermissions(string path, string mask, string user, strin
|
|||||||
|
|
||||||
public override List<IMount> GetMounts()
|
public override List<IMount> GetMounts()
|
||||||
{
|
{
|
||||||
var mounts = GetDriveInfoMounts().Select(d => new DriveInfoMount(d, FindDriveType.Find(d.DriveFormat)))
|
return _procMountProvider.GetMounts()
|
||||||
.Where(d => d.DriveType == DriveType.Fixed || d.DriveType == DriveType.Network || d.DriveType == DriveType.Removable);
|
.Concat(GetDriveInfoMounts()
|
||||||
|
.Select(d => new DriveInfoMount(d, FindDriveType.Find(d.DriveFormat)))
|
||||||
|
.Where(d => d.DriveType == DriveType.Fixed ||
|
||||||
|
d.DriveType == DriveType.Network ||
|
||||||
var procMounts = _procMountProvider.GetMounts();
|
d.DriveType == DriveType.Removable))
|
||||||
|
.DistinctBy(v => v.RootDirectory)
|
||||||
if (procMounts != null)
|
.ToList();
|
||||||
{
|
|
||||||
return mounts.Concat(procMounts).DistinctBy(v => v.RootDirectory)
|
|
||||||
.ToList();
|
|
||||||
}
|
|
||||||
|
|
||||||
return mounts.Cast<IMount>().DistinctBy(v => v.RootDirectory)
|
|
||||||
.ToList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override long? GetTotalSize(string path)
|
public override long? GetTotalSize(string path)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using NzbDrone.Common.Extensions;
|
using NzbDrone.Common.Extensions;
|
||||||
|
|
||||||
@ -9,6 +9,7 @@ public static class FindDriveType
|
|||||||
private static readonly Dictionary<string, DriveType> DriveTypeMap = new Dictionary<string, DriveType>
|
private static readonly Dictionary<string, DriveType> DriveTypeMap = new Dictionary<string, DriveType>
|
||||||
{
|
{
|
||||||
{ "afpfs", DriveType.Network },
|
{ "afpfs", DriveType.Network },
|
||||||
|
{ "apfs", DriveType.Fixed },
|
||||||
{ "zfs", DriveType.Fixed }
|
{ "zfs", DriveType.Fixed }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user