diff --git a/frontend/src/RootFolder/RootFolders.js b/frontend/src/RootFolder/RootFolders.js index 57598dbb9..a07209ecc 100644 --- a/frontend/src/RootFolder/RootFolders.js +++ b/frontend/src/RootFolder/RootFolders.js @@ -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} /> diff --git a/src/NzbDrone.Core/Datastore/TableMapping.cs b/src/NzbDrone.Core/Datastore/TableMapping.cs index 1a42e82cc..7652e53bc 100644 --- a/src/NzbDrone.Core/Datastore/TableMapping.cs +++ b/src/NzbDrone.Core/Datastore/TableMapping.cs @@ -52,6 +52,7 @@ public static void Map() Mapper.Entity().RegisterModel("Config"); Mapper.Entity().RegisterModel("RootFolders") + .Ignore(r => r.Accessible) .Ignore(r => r.FreeSpace) .Ignore(r => r.TotalSpace); diff --git a/src/NzbDrone.Core/RootFolders/RootFolder.cs b/src/NzbDrone.Core/RootFolders/RootFolder.cs index f32716b52..0ae3b0155 100644 --- a/src/NzbDrone.Core/RootFolders/RootFolder.cs +++ b/src/NzbDrone.Core/RootFolders/RootFolder.cs @@ -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; } diff --git a/src/NzbDrone.Core/RootFolders/RootFolderService.cs b/src/NzbDrone.Core/RootFolders/RootFolderService.cs index 648181959..b82b24dea 100644 --- a/src/NzbDrone.Core/RootFolders/RootFolderService.cs +++ b/src/NzbDrone.Core/RootFolders/RootFolderService.cs @@ -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); } } } diff --git a/src/Radarr.Api.V2/RootFolders/RootFolderResource.cs b/src/Radarr.Api.V2/RootFolders/RootFolderResource.cs index c8dbab65b..566c999d4 100644 --- a/src/Radarr.Api.V2/RootFolders/RootFolderResource.cs +++ b/src/Radarr.Api.V2/RootFolders/RootFolderResource.cs @@ -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 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 };