mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-30 19:56:54 +00:00
parent
6bfb790eb8
commit
2246dfab05
1 changed files with 7 additions and 27 deletions
|
@ -40,24 +40,15 @@ namespace NzbDrone.Mono.Disk
|
||||||
{
|
{
|
||||||
Ensure.That(path, () => path).IsValidPath();
|
Ensure.That(path, () => path).IsValidPath();
|
||||||
|
|
||||||
try
|
var mount = GetMount(path);
|
||||||
{
|
|
||||||
var mount = GetMount(path);
|
|
||||||
|
|
||||||
if (mount == null)
|
if (mount == null)
|
||||||
{
|
|
||||||
Logger.Debug("Unable to get free space for '{0}', unable to find suitable drive", path);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return mount.AvailableFreeSpace;
|
|
||||||
}
|
|
||||||
catch (InvalidOperationException ex)
|
|
||||||
{
|
{
|
||||||
Logger.Error(ex, "Couldn't get free space for {0}", path);
|
Logger.Debug("Unable to get free space for '{0}', unable to find suitable drive", path);
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return mount.AvailableFreeSpace;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void InheritFolderPermissions(string filename)
|
public override void InheritFolderPermissions(string filename)
|
||||||
|
@ -100,20 +91,9 @@ namespace NzbDrone.Mono.Disk
|
||||||
{
|
{
|
||||||
Ensure.That(path, () => path).IsValidPath();
|
Ensure.That(path, () => path).IsValidPath();
|
||||||
|
|
||||||
try
|
var mount = GetMount(path);
|
||||||
{
|
|
||||||
var mount = GetMount(path);
|
|
||||||
|
|
||||||
if (mount == null) return null;
|
return mount?.TotalSize;
|
||||||
|
|
||||||
return mount.TotalSize;
|
|
||||||
}
|
|
||||||
catch (InvalidOperationException e)
|
|
||||||
{
|
|
||||||
Logger.Error(e, "Couldn't get total space for {0}", path);
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool TryCreateHardLink(string source, string destination)
|
public override bool TryCreateHardLink(string source, string destination)
|
||||||
|
|
Loading…
Reference in a new issue