diff --git a/MediaBrowser.ServerApplication/ApplicationHost.cs b/MediaBrowser.ServerApplication/ApplicationHost.cs index 4ec3b73122..c277ee5098 100644 --- a/MediaBrowser.ServerApplication/ApplicationHost.cs +++ b/MediaBrowser.ServerApplication/ApplicationHost.cs @@ -170,6 +170,8 @@ namespace MediaBrowser.ServerApplication private Task _httpServerCreationTask; + private IFileSystem FileSystemManager { get; set; } + /// /// Initializes a new instance of the class. /// @@ -247,8 +249,8 @@ namespace MediaBrowser.ServerApplication RegisterSingleInstance(() => new BdInfoExaminer()); - var fileSystemManager = FileSystemFactory.CreateFileSystemManager(); - RegisterSingleInstance(fileSystemManager); + FileSystemManager = FileSystemFactory.CreateFileSystemManager(); + RegisterSingleInstance(FileSystemManager); var mediaEncoderTask = RegisterMediaEncoder(); @@ -267,10 +269,10 @@ namespace MediaBrowser.ServerApplication UserManager = new UserManager(Logger, ServerConfigurationManager, UserRepository); RegisterSingleInstance(UserManager); - LibraryManager = new LibraryManager(Logger, TaskManager, UserManager, ServerConfigurationManager, UserDataManager, () => DirectoryWatchers, fileSystemManager); + LibraryManager = new LibraryManager(Logger, TaskManager, UserManager, ServerConfigurationManager, UserDataManager, () => DirectoryWatchers, FileSystemManager); RegisterSingleInstance(LibraryManager); - DirectoryWatchers = new DirectoryWatchers(LogManager, TaskManager, LibraryManager, ServerConfigurationManager, fileSystemManager); + DirectoryWatchers = new DirectoryWatchers(LogManager, TaskManager, LibraryManager, ServerConfigurationManager, FileSystemManager); RegisterSingleInstance(DirectoryWatchers); ProviderManager = new ProviderManager(HttpClient, ServerConfigurationManager, DirectoryWatchers, LogManager, LibraryManager); @@ -416,6 +418,7 @@ namespace MediaBrowser.ServerApplication User.UserManager = UserManager; LocalizedStrings.ApplicationPaths = ApplicationPaths; Folder.UserManager = UserManager; + BaseItem.FileSystem = FileSystemManager; } ///