mirror of https://github.com/lidarr/Lidarr
Fixed: Logging error when accessing mount point
This commit is contained in:
parent
028e7d1c7d
commit
c91f4b4442
|
@ -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;
|
||||||
|
@ -40,8 +40,6 @@ 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)
|
||||||
|
@ -52,13 +50,6 @@ namespace NzbDrone.Mono.Disk
|
||||||
|
|
||||||
return mount.AvailableFreeSpace;
|
return mount.AvailableFreeSpace;
|
||||||
}
|
}
|
||||||
catch (InvalidOperationException ex)
|
|
||||||
{
|
|
||||||
Logger.Error(ex, "Couldn't get free space for {0}", path);
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
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 New Issue