aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Library/LibraryStructureService.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-10-30 10:40:14 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-10-30 10:40:14 -0400
commitbe7918e5f68f67ed32a50c2d86ee9cae79cf2b93 (patch)
treeb27b8be23f3771e77c6e3d41b1fec58b682c4891 /MediaBrowser.Api/Library/LibraryStructureService.cs
parentcbd6c47af49145f3136cab9858b87ce98df9071a (diff)
fixes #567 - Deprecate native shortcut code
Diffstat (limited to 'MediaBrowser.Api/Library/LibraryStructureService.cs')
-rw-r--r--MediaBrowser.Api/Library/LibraryStructureService.cs17
1 files changed, 10 insertions, 7 deletions
diff --git a/MediaBrowser.Api/Library/LibraryStructureService.cs b/MediaBrowser.Api/Library/LibraryStructureService.cs
index e6fa1d1c0..a5476ec8b 100644
--- a/MediaBrowser.Api/Library/LibraryStructureService.cs
+++ b/MediaBrowser.Api/Library/LibraryStructureService.cs
@@ -186,6 +186,8 @@ namespace MediaBrowser.Api.Library
private readonly IDirectoryWatchers _directoryWatchers;
+ private readonly IFileSystem _fileSystem;
+
/// <summary>
/// Initializes a new instance of the <see cref="LibraryStructureService"/> class.
/// </summary>
@@ -193,7 +195,7 @@ namespace MediaBrowser.Api.Library
/// <param name="userManager">The user manager.</param>
/// <param name="libraryManager">The library manager.</param>
/// <exception cref="System.ArgumentNullException">appPaths</exception>
- public LibraryStructureService(IServerApplicationPaths appPaths, IUserManager userManager, ILibraryManager libraryManager, IDirectoryWatchers directoryWatchers)
+ public LibraryStructureService(IServerApplicationPaths appPaths, IUserManager userManager, ILibraryManager libraryManager, IDirectoryWatchers directoryWatchers, IFileSystem fileSystem)
{
if (appPaths == null)
{
@@ -204,6 +206,7 @@ namespace MediaBrowser.Api.Library
_appPaths = appPaths;
_libraryManager = libraryManager;
_directoryWatchers = directoryWatchers;
+ _fileSystem = fileSystem;
}
/// <summary>
@@ -241,13 +244,13 @@ namespace MediaBrowser.Api.Library
{
if (string.IsNullOrEmpty(request.UserId))
{
- LibraryHelpers.AddVirtualFolder(request.Name, request.CollectionType, null, _appPaths);
+ LibraryHelpers.AddVirtualFolder(_fileSystem, request.Name, request.CollectionType, null, _appPaths);
}
else
{
var user = _userManager.GetUserById(new Guid(request.UserId));
- LibraryHelpers.AddVirtualFolder(request.Name, request.CollectionType, user, _appPaths);
+ LibraryHelpers.AddVirtualFolder(_fileSystem, request.Name, request.CollectionType, user, _appPaths);
}
// Need to add a delay here or directory watchers may still pick up the changes
@@ -352,13 +355,13 @@ namespace MediaBrowser.Api.Library
{
if (string.IsNullOrEmpty(request.UserId))
{
- LibraryHelpers.AddMediaPath(request.Name, request.Path, null, _appPaths);
+ LibraryHelpers.AddMediaPath(_fileSystem, request.Name, request.Path, null, _appPaths);
}
else
{
var user = _userManager.GetUserById(new Guid(request.UserId));
- LibraryHelpers.AddMediaPath(request.Name, request.Path, user, _appPaths);
+ LibraryHelpers.AddMediaPath(_fileSystem, request.Name, request.Path, user, _appPaths);
}
// Need to add a delay here or directory watchers may still pick up the changes
@@ -389,13 +392,13 @@ namespace MediaBrowser.Api.Library
{
if (string.IsNullOrEmpty(request.UserId))
{
- LibraryHelpers.RemoveMediaPath(request.Name, request.Path, null, _appPaths);
+ LibraryHelpers.RemoveMediaPath(_fileSystem, request.Name, request.Path, null, _appPaths);
}
else
{
var user = _userManager.GetUserById(new Guid(request.UserId));
- LibraryHelpers.RemoveMediaPath(request.Name, request.Path, user, _appPaths);
+ LibraryHelpers.RemoveMediaPath(_fileSystem, request.Name, request.Path, user, _appPaths);
}
// Need to add a delay here or directory watchers may still pick up the changes