mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 20:12:41 +02:00
Fixed: Root Folder display when free diskspace cannot be determined (FreeBSD)
closes #3275
This commit is contained in:
parent
f2200f793d
commit
40736336db
@ -59,6 +59,7 @@ function RootFolders(props) {
|
||||
key={rootFolder.id}
|
||||
id={rootFolder.id}
|
||||
path={rootFolder.path}
|
||||
accessible={rootFolder.accessible}
|
||||
freeSpace={rootFolder.freeSpace}
|
||||
unmappedFolders={rootFolder.unmappedFolders}
|
||||
/>
|
||||
|
@ -52,6 +52,7 @@ public static void Map()
|
||||
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 @@ public class RootFolder : ModelBase
|
||||
{
|
||||
public string Path { get; set; }
|
||||
|
||||
public bool Accessible { get; set; }
|
||||
public long? FreeSpace { get; set; }
|
||||
public long? TotalSpace { get; set; }
|
||||
|
||||
|
@ -191,12 +191,12 @@ private void GetDetails(RootFolder rootFolder)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ namespace Radarr.Api.V2.RootFolders
|
||||
public class RootFolderResource : RestResource
|
||||
{
|
||||
public string Path { get; set; }
|
||||
public bool Accessible { get; set; }
|
||||
public long? FreeSpace { get; set; }
|
||||
|
||||
public List<UnmappedFolder> UnmappedFolders { get; set; }
|
||||
@ -25,6 +26,7 @@ public static RootFolderResource ToResource(this RootFolder model)
|
||||
Id = model.Id,
|
||||
|
||||
Path = model.Path.GetCleanPath(),
|
||||
Accessible = model.Accessible,
|
||||
FreeSpace = model.FreeSpace,
|
||||
UnmappedFolders = model.UnmappedFolders
|
||||
};
|
||||
@ -39,6 +41,7 @@ public static RootFolder ToModel(this RootFolderResource resource)
|
||||
Id = resource.Id,
|
||||
|
||||
Path = resource.Path
|
||||
//Accessible
|
||||
//FreeSpace
|
||||
//UnmappedFolders
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user