mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-22 14:33:30 -07:00
Fixed: Root Folder display when free diskspace cannot be determined (FreeBSD)
closes #3275
This commit is contained in:
parent
be829a15ca
commit
cf2aefd808
6 changed files with 13 additions and 6 deletions
|
@ -8,6 +8,7 @@ namespace Lidarr.Api.V1.RootFolders
|
|||
public class RootFolderResource : RestResource
|
||||
{
|
||||
public string Path { get; set; }
|
||||
public bool Accessible { get; set; }
|
||||
public long? FreeSpace { get; set; }
|
||||
public long? TotalSpace { get; set; }
|
||||
|
||||
|
@ -25,6 +26,7 @@ namespace Lidarr.Api.V1.RootFolders
|
|||
Id = model.Id,
|
||||
|
||||
Path = model.Path,
|
||||
Accessible = model.Accessible,
|
||||
FreeSpace = model.FreeSpace,
|
||||
TotalSpace = model.TotalSpace,
|
||||
UnmappedFolders = model.UnmappedFolders
|
||||
|
@ -40,6 +42,7 @@ namespace Lidarr.Api.V1.RootFolders
|
|||
Id = resource.Id,
|
||||
|
||||
Path = resource.Path,
|
||||
//Accessible
|
||||
//FreeSpace
|
||||
//UnmappedFolders
|
||||
};
|
||||
|
|
|
@ -53,6 +53,7 @@ namespace NzbDrone.Core.Datastore
|
|||
Mapper.Entity<Config>().RegisterModel("Config");
|
||||
|
||||
Mapper.Entity<RootFolder>().RegisterModel("RootFolders")
|
||||
.Ignore(r => r.Accessible)
|
||||
.Ignore(r => r.FreeSpace)
|
||||
.Ignore(r => r.TotalSpace);
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ namespace NzbDrone.Core.RootFolders
|
|||
{
|
||||
public string Path { get; set; }
|
||||
|
||||
public bool Accessible { get; set; }
|
||||
public long? FreeSpace { get; set; }
|
||||
public long? TotalSpace { get; set; }
|
||||
|
||||
|
|
|
@ -183,12 +183,12 @@ namespace NzbDrone.Core.RootFolders
|
|||
{
|
||||
if (_diskProvider.FolderExists(rootFolder.Path))
|
||||
{
|
||||
rootFolder.Accessible = true;
|
||||
rootFolder.FreeSpace = _diskProvider.GetAvailableSpace(rootFolder.Path);
|
||||
rootFolder.TotalSpace = _diskProvider.GetTotalSize(rootFolder.Path);
|
||||
rootFolder.UnmappedFolders = GetUnmappedFolders(rootFolder.Path);
|
||||
}
|
||||
})
|
||||
.Wait(5000);
|
||||
}).Wait(5000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue