mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-08-04 07:10:45 +00:00
make api project portable
This commit is contained in:
parent
b28857feea
commit
13d8110ce2
35 changed files with 326 additions and 255 deletions
|
|
@ -577,6 +577,23 @@ namespace Emby.Common.Implementations.IO
|
|||
Directory.CreateDirectory(path);
|
||||
}
|
||||
|
||||
public List<FileSystemMetadata> GetDrives()
|
||||
{
|
||||
// Only include drives in the ready state or this method could end up being very slow, waiting for drives to timeout
|
||||
return DriveInfo.GetDrives().Where(d => d.IsReady).Select(d => new FileSystemMetadata
|
||||
{
|
||||
Name = GetName(d),
|
||||
FullName = d.RootDirectory.FullName,
|
||||
IsDirectory = true
|
||||
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
private string GetName(DriveInfo drive)
|
||||
{
|
||||
return drive.Name;
|
||||
}
|
||||
|
||||
public IEnumerable<FileSystemMetadata> GetDirectories(string path, bool recursive = false)
|
||||
{
|
||||
var searchOption = recursive ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue