aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Library/LibraryService.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2015-10-26 18:50:19 -0400
committerLuke <luke.pulverenti@gmail.com>2015-10-26 18:50:19 -0400
commit35778ebc02e5931142a1fe31a256b7488a07c5c2 (patch)
treeced0290be8820f5e507b51ca4c5165212b1879d1 /MediaBrowser.Api/Library/LibraryService.cs
parentc0dc8d055bfd4d2f58591083beb9e9128357aad6 (diff)
parent8d77308593c3b16b733b0109323770d9dfe7e166 (diff)
Merge pull request #1222 from MediaBrowser/dev
3.0.5768.7
Diffstat (limited to 'MediaBrowser.Api/Library/LibraryService.cs')
-rw-r--r--MediaBrowser.Api/Library/LibraryService.cs10
1 files changed, 7 insertions, 3 deletions
diff --git a/MediaBrowser.Api/Library/LibraryService.cs b/MediaBrowser.Api/Library/LibraryService.cs
index 49dd121ba..319bc13fd 100644
--- a/MediaBrowser.Api/Library/LibraryService.cs
+++ b/MediaBrowser.Api/Library/LibraryService.cs
@@ -27,6 +27,8 @@ using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
+using CommonIO;
+using MediaBrowser.Common.IO;
namespace MediaBrowser.Api.Library
{
@@ -282,12 +284,13 @@ namespace MediaBrowser.Api.Library
private readonly IChannelManager _channelManager;
private readonly ITVSeriesManager _tvManager;
private readonly ILibraryMonitor _libraryMonitor;
+ private readonly IFileSystem _fileSystem;
/// <summary>
/// Initializes a new instance of the <see cref="LibraryService" /> class.
/// </summary>
public LibraryService(IItemRepository itemRepo, ILibraryManager libraryManager, IUserManager userManager,
- IDtoService dtoService, IUserDataManager userDataManager, IAuthorizationContext authContext, IActivityManager activityManager, ILocalizationManager localization, ILiveTvManager liveTv, IChannelManager channelManager, ITVSeriesManager tvManager, ILibraryMonitor libraryMonitor)
+ IDtoService dtoService, IUserDataManager userDataManager, IAuthorizationContext authContext, IActivityManager activityManager, ILocalizationManager localization, ILiveTvManager liveTv, IChannelManager channelManager, ITVSeriesManager tvManager, ILibraryMonitor libraryMonitor, IFileSystem fileSystem)
{
_itemRepo = itemRepo;
_libraryManager = libraryManager;
@@ -301,6 +304,7 @@ namespace MediaBrowser.Api.Library
_channelManager = channelManager;
_tvManager = tvManager;
_libraryMonitor = libraryMonitor;
+ _fileSystem = fileSystem;
}
public object Get(GetSimilarItems request)
@@ -557,7 +561,7 @@ namespace MediaBrowser.Api.Library
{
throw new ArgumentException("This command cannot be used for remote or virtual items.");
}
- if (Directory.Exists(item.Path))
+ if (_fileSystem.DirectoryExists(item.Path))
{
throw new ArgumentException("This command cannot be used for directories.");
}
@@ -719,7 +723,7 @@ namespace MediaBrowser.Api.Library
if (!item.CanDelete(user))
{
- throw new UnauthorizedAccessException();
+ throw new SecurityException("Unauthorized access");
}
if (item is ILiveTvRecording)