mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-02 22:08:27 +01:00
make api project portable
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -43,7 +43,8 @@
|
||||
"MediaBrowser.Model": {
|
||||
"target": "project"
|
||||
},
|
||||
"System.Net.Requests": "4.0.11",
|
||||
"System.IO.FileSystem.DriveInfo": "4.0.0",
|
||||
"System.Net.Requests": "4.0.11",
|
||||
"System.Xml.XmlSerializer": "4.0.11",
|
||||
"System.Net.Http": "4.1.0",
|
||||
"System.Net.Primitives": "4.0.11",
|
||||
|
||||
Reference in New Issue
Block a user