aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Implementations')
-rw-r--r--MediaBrowser.Server.Implementations/Devices/DeviceManager.cs4
-rw-r--r--MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs9
2 files changed, 8 insertions, 5 deletions
diff --git a/MediaBrowser.Server.Implementations/Devices/DeviceManager.cs b/MediaBrowser.Server.Implementations/Devices/DeviceManager.cs
index 0173f2784..548a2222a 100644
--- a/MediaBrowser.Server.Implementations/Devices/DeviceManager.cs
+++ b/MediaBrowser.Server.Implementations/Devices/DeviceManager.cs
@@ -157,7 +157,7 @@ namespace MediaBrowser.Server.Implementations.Devices
_libraryMonitor.ReportFileSystemChangeBeginning(path);
- Directory.CreateDirectory(Path.GetDirectoryName(path));
+ _fileSystem.CreateDirectory(Path.GetDirectoryName(path));
try
{
@@ -290,4 +290,4 @@ namespace MediaBrowser.Server.Implementations.Devices
return config.GetConfiguration<DevicesOptions>("devices");
}
}
-}
+} \ No newline at end of file
diff --git a/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs b/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs
index 63067bf5a..8ef7e94c2 100644
--- a/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs
+++ b/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs
@@ -15,6 +15,7 @@ using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
+using MediaBrowser.Common.IO;
namespace MediaBrowser.Server.Implementations.Library
{
@@ -24,17 +25,19 @@ namespace MediaBrowser.Server.Implementations.Library
private readonly IUserManager _userManager;
private readonly ILibraryManager _libraryManager;
private readonly IJsonSerializer _jsonSerializer;
+ private readonly IFileSystem _fileSystem;
private IMediaSourceProvider[] _providers;
private readonly ILogger _logger;
- public MediaSourceManager(IItemRepository itemRepo, IUserManager userManager, ILibraryManager libraryManager, ILogger logger, IJsonSerializer jsonSerializer)
+ public MediaSourceManager(IItemRepository itemRepo, IUserManager userManager, ILibraryManager libraryManager, ILogger logger, IJsonSerializer jsonSerializer, IFileSystem fileSystem)
{
_itemRepo = itemRepo;
_userManager = userManager;
_libraryManager = libraryManager;
_logger = logger;
_jsonSerializer = jsonSerializer;
+ _fileSystem = fileSystem;
}
public void AddParts(IEnumerable<IMediaSourceProvider> providers)
@@ -170,7 +173,7 @@ namespace MediaBrowser.Server.Implementations.Library
if (source.Protocol == MediaProtocol.File)
{
// TODO: Path substitution
- if (!File.Exists(source.Path))
+ if (!_fileSystem.FileExists(source.Path))
{
source.SupportsDirectStream = false;
}
@@ -582,4 +585,4 @@ namespace MediaBrowser.Server.Implementations.Library
public MediaSourceInfo MediaSource;
}
}
-}
+} \ No newline at end of file