|
|
@ -18,7 +18,7 @@ namespace NzbDrone.Core.RootFolders
|
|
|
|
List<RootFolder> AllWithUnmappedFolders();
|
|
|
|
List<RootFolder> AllWithUnmappedFolders();
|
|
|
|
RootFolder Add(RootFolder rootDir);
|
|
|
|
RootFolder Add(RootFolder rootDir);
|
|
|
|
void Remove(int id);
|
|
|
|
void Remove(int id);
|
|
|
|
RootFolder Get(int id);
|
|
|
|
RootFolder Get(int id, bool timeout);
|
|
|
|
string GetBestRootFolderPath(string path);
|
|
|
|
string GetBestRootFolderPath(string path);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -73,7 +73,7 @@ namespace NzbDrone.Core.RootFolders
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (folder.Path.IsPathValid())
|
|
|
|
if (folder.Path.IsPathValid())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
GetDetails(folder);
|
|
|
|
GetDetails(folder, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -114,7 +114,7 @@ namespace NzbDrone.Core.RootFolders
|
|
|
|
|
|
|
|
|
|
|
|
_rootFolderRepository.Insert(rootFolder);
|
|
|
|
_rootFolderRepository.Insert(rootFolder);
|
|
|
|
|
|
|
|
|
|
|
|
GetDetails(rootFolder);
|
|
|
|
GetDetails(rootFolder, true);
|
|
|
|
|
|
|
|
|
|
|
|
return rootFolder;
|
|
|
|
return rootFolder;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -161,10 +161,10 @@ namespace NzbDrone.Core.RootFolders
|
|
|
|
return results.OrderBy(u => u.Name, StringComparer.InvariantCultureIgnoreCase).ToList();
|
|
|
|
return results.OrderBy(u => u.Name, StringComparer.InvariantCultureIgnoreCase).ToList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public RootFolder Get(int id)
|
|
|
|
public RootFolder Get(int id, bool timeout)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var rootFolder = _rootFolderRepository.Get(id);
|
|
|
|
var rootFolder = _rootFolderRepository.Get(id);
|
|
|
|
GetDetails(rootFolder);
|
|
|
|
GetDetails(rootFolder, timeout);
|
|
|
|
|
|
|
|
|
|
|
|
return rootFolder;
|
|
|
|
return rootFolder;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -183,7 +183,7 @@ namespace NzbDrone.Core.RootFolders
|
|
|
|
return possibleRootFolder.Path;
|
|
|
|
return possibleRootFolder.Path;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void GetDetails(RootFolder rootFolder)
|
|
|
|
private void GetDetails(RootFolder rootFolder, bool timeout)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Task.Run(() =>
|
|
|
|
Task.Run(() =>
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -194,7 +194,7 @@ namespace NzbDrone.Core.RootFolders
|
|
|
|
rootFolder.TotalSpace = _diskProvider.GetTotalSize(rootFolder.Path);
|
|
|
|
rootFolder.TotalSpace = _diskProvider.GetTotalSize(rootFolder.Path);
|
|
|
|
rootFolder.UnmappedFolders = GetUnmappedFolders(rootFolder.Path);
|
|
|
|
rootFolder.UnmappedFolders = GetUnmappedFolders(rootFolder.Path);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).Wait(5000);
|
|
|
|
}).Wait(timeout ? 5000 : -1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|