aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Library/LibraryStructureService.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-09-23 02:21:54 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-09-23 02:21:54 -0400
commit8b096ccc0e87883655bcf9ea1f9e22e9961450d3 (patch)
tree79c4ed4a9e5f7155ae641e33c71cf9060a99c6ac /MediaBrowser.Api/Library/LibraryStructureService.cs
parentbfb2f64ea480a35c973362f014e1caee7918b713 (diff)
stub out storage for new path substitution
Diffstat (limited to 'MediaBrowser.Api/Library/LibraryStructureService.cs')
-rw-r--r--MediaBrowser.Api/Library/LibraryStructureService.cs20
1 files changed, 18 insertions, 2 deletions
diff --git a/MediaBrowser.Api/Library/LibraryStructureService.cs b/MediaBrowser.Api/Library/LibraryStructureService.cs
index 72966a7cd..0ed4ee2a2 100644
--- a/MediaBrowser.Api/Library/LibraryStructureService.cs
+++ b/MediaBrowser.Api/Library/LibraryStructureService.cs
@@ -112,6 +112,8 @@ namespace MediaBrowser.Api.Library
/// <value>The name.</value>
public string Path { get; set; }
+ public MediaPathInfo PathInfo { get; set; }
+
/// <summary>
/// Gets or sets a value indicating whether [refresh library].
/// </summary>
@@ -212,7 +214,12 @@ namespace MediaBrowser.Api.Library
{
var libraryOptions = request.LibraryOptions ?? new LibraryOptions();
- _libraryManager.AddVirtualFolder(request.Name, request.CollectionType, request.Paths, libraryOptions, request.RefreshLibrary);
+ if (request.Paths != null && request.Paths.Length > 0)
+ {
+ libraryOptions.PathInfos = request.Paths.Select(i => new MediaPathInfo { Path = i }).ToArray();
+ }
+
+ _libraryManager.AddVirtualFolder(request.Name, request.CollectionType, libraryOptions, request.RefreshLibrary);
}
/// <summary>
@@ -308,7 +315,16 @@ namespace MediaBrowser.Api.Library
try
{
- _libraryManager.AddMediaPath(request.Name, request.Path);
+ var mediaPath = request.PathInfo;
+
+ if (mediaPath == null)
+ {
+ mediaPath = new MediaPathInfo
+ {
+ Path = request.Path
+ };
+ }
+ _libraryManager.AddMediaPath(request.Name, mediaPath);
}
finally
{