aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/EnvironmentService.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-07-23 02:49:46 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-07-23 02:49:46 -0400
commit61d0795c844e30e379ab379efb3244e8c14dbf31 (patch)
tree75c25b9d9bce0ca59362ac281ce091bb8b538781 /MediaBrowser.Api/EnvironmentService.cs
parent2aeee846f421ec3a0e943d0cdcdedcdb250904ce (diff)
set default directory picker path for qnap
Diffstat (limited to 'MediaBrowser.Api/EnvironmentService.cs')
-rw-r--r--MediaBrowser.Api/EnvironmentService.cs32
1 files changed, 31 insertions, 1 deletions
diff --git a/MediaBrowser.Api/EnvironmentService.cs b/MediaBrowser.Api/EnvironmentService.cs
index 4e88e946f..e137a4baf 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,26 @@ namespace MediaBrowser.Api
_fileSystem = fileSystem;
}
+ public object Get(GetDefaultDirectoryBrowser request)
+ {
+ var result = new DefaultDirectoryBrowserInfo();
+
+ try
+ {
+ var qnap = "/share/CACHEDEV1_DATA";
+ if (Directory.Exists(qnap))
+ {
+ result.Path = qnap;
+ }
+ }
+ catch
+ {
+
+ }
+
+ return ToOptimizedResult(result);
+ }
+
/// <summary>
/// Gets the specified request.
/// </summary>