diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-10-26 01:29:32 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-10-26 01:29:32 -0400 |
| commit | c80e1df1ca1b5b2a082bf6a10e0c4c35d3a31f3b (patch) | |
| tree | b4decdfd240182061ab55299b12798b429f7a82d /MediaBrowser.Api/Library/LibraryStructureService.cs | |
| parent | 2890c71af92dcb6920c4ab7da48cd6807ca86703 (diff) | |
support null image encoder
Diffstat (limited to 'MediaBrowser.Api/Library/LibraryStructureService.cs')
| -rw-r--r-- | MediaBrowser.Api/Library/LibraryStructureService.cs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/MediaBrowser.Api/Library/LibraryStructureService.cs b/MediaBrowser.Api/Library/LibraryStructureService.cs index 76abfb743..decd19602 100644 --- a/MediaBrowser.Api/Library/LibraryStructureService.cs +++ b/MediaBrowser.Api/Library/LibraryStructureService.cs @@ -52,7 +52,7 @@ namespace MediaBrowser.Api.Library /// Gets or sets the path. /// </summary> /// <value>The path.</value> - public string Path { get; set; } + public string[] Paths { get; set; } } [Route("/Library/VirtualFolders", "DELETE")] @@ -207,11 +207,12 @@ namespace MediaBrowser.Api.Library throw new ArgumentException("There is already a media library with the name " + name + "."); } - if (!string.IsNullOrWhiteSpace(request.Path)) + if (request.Paths != null) { - if (!_fileSystem.DirectoryExists(request.Path)) + var invalidpath = request.Paths.FirstOrDefault(i => !_fileSystem.DirectoryExists(i)); + if (invalidpath != null) { - throw new DirectoryNotFoundException("The specified folder does not exist."); + throw new ArgumentException("The specified path does not exist: " + invalidpath + "."); } } @@ -231,9 +232,12 @@ namespace MediaBrowser.Api.Library } } - if (!string.IsNullOrWhiteSpace(request.Path)) + if (request.Paths != null) { - LibraryHelpers.AddMediaPath(_fileSystem, request.Name, request.Path, _appPaths); + foreach (var path in request.Paths) + { + LibraryHelpers.AddMediaPath(_fileSystem, request.Name, path, _appPaths); + } } } finally |
