diff options
| author | hatharry <hatharry@hotmail.com> | 2016-07-25 23:29:52 +1200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-07-25 23:29:52 +1200 |
| commit | f21f9923de6291aaf985f32dbbbaddbb26d07fb1 (patch) | |
| tree | 1a313e9a1c6790a755926bcef221c5f680537eae /MediaBrowser.Api/EnvironmentService.cs | |
| parent | 6332d0b9436c511a59e2abd67ea8c24ce3d82ace (diff) | |
| parent | 8328f39834f042e1808fd8506bbc7c48151703ab (diff) | |
Merge pull request #15 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.Api/EnvironmentService.cs')
| -rw-r--r-- | MediaBrowser.Api/EnvironmentService.cs | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/MediaBrowser.Api/EnvironmentService.cs b/MediaBrowser.Api/EnvironmentService.cs index 4e88e946f..b354cb26c 100644 --- a/MediaBrowser.Api/EnvironmentService.cs +++ b/MediaBrowser.Api/EnvironmentService.cs @@ -90,6 +90,17 @@ namespace MediaBrowser.Api public string Path { get; set; } } + public class DefaultDirectoryBrowserInfo + { + public string Path { get; set; } + } + + [Route("/Environment/DefaultDirectoryBrowser", "GET", Summary = "Gets the parent path of a given path")] + public class GetDefaultDirectoryBrowser : IReturn<DefaultDirectoryBrowserInfo> + { + + } + /// <summary> /// Class EnvironmentService /// </summary> @@ -108,7 +119,6 @@ namespace MediaBrowser.Api /// Initializes a new instance of the <see cref="EnvironmentService" /> class. /// </summary> /// <param name="networkManager">The network manager.</param> - /// <exception cref="System.ArgumentNullException">networkManager</exception> public EnvironmentService(INetworkManager networkManager, IFileSystem fileSystem) { if (networkManager == null) @@ -120,6 +130,29 @@ namespace MediaBrowser.Api _fileSystem = fileSystem; } + public object Get(GetDefaultDirectoryBrowser request) + { + var result = new DefaultDirectoryBrowserInfo(); + + if (Environment.OSVersion.Platform == PlatformID.Unix) + { + try + { + var qnap = "/share/CACHEDEV1_DATA"; + if (Directory.Exists(qnap)) + { + result.Path = qnap; + } + } + catch + { + + } + } + + return ToOptimizedResult(result); + } + /// <summary> /// Gets the specified request. /// </summary> |
