mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-21 22:25:03 -04:00
Add FileInfo utility functions to DiskProvider
This commit is contained in:
@@ -505,13 +505,20 @@ namespace NzbDrone.Common.Disk
|
||||
return di.GetDirectories().ToList();
|
||||
}
|
||||
|
||||
public List<FileInfo> GetFileInfos(string path)
|
||||
public FileInfo GetFileInfo(string path)
|
||||
{
|
||||
Ensure.That(path, () => path).IsValidPath();
|
||||
|
||||
return new FileInfo(path);
|
||||
}
|
||||
|
||||
public List<FileInfo> GetFileInfos(string path, SearchOption searchOption = SearchOption.TopDirectoryOnly)
|
||||
{
|
||||
Ensure.That(path, () => path).IsValidPath();
|
||||
|
||||
var di = new DirectoryInfo(path);
|
||||
|
||||
return di.GetFiles().ToList();
|
||||
return di.GetFiles("*", searchOption).ToList();
|
||||
}
|
||||
|
||||
public void RemoveEmptySubfolders(string path)
|
||||
|
||||
Reference in New Issue
Block a user