diff options
| author | Sven Van den brande <sven.vandenbrande@outlook.com> | 2013-10-31 21:46:03 +0100 |
|---|---|---|
| committer | Sven Van den brande <sven.vandenbrande@outlook.com> | 2013-10-31 21:46:03 +0100 |
| commit | e8f8d6651c86b3fd3350a5afae1d759fbbad06bd (patch) | |
| tree | 6496b1525f0dfc448f0250f4fddaa634296ae94b /MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs | |
| parent | 28ab28768a307d1cac60ebe79163b98291068cde (diff) | |
| parent | 882d0681e68c5e0ae663cca75752e4df765c8dd5 (diff) | |
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs b/MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs index c9777e54a..0d428742c 100644 --- a/MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs +++ b/MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs @@ -1,4 +1,6 @@ -using MediaBrowser.Controller.Configuration; +using MediaBrowser.Common.IO; +using MediaBrowser.Controller.Configuration; +using MediaBrowser.Controller.IO; using MediaBrowser.Controller.Localization; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Globalization; @@ -30,13 +32,16 @@ namespace MediaBrowser.Server.Implementations.Localization private readonly ConcurrentDictionary<string, Dictionary<string, ParentalRating>> _allParentalRatings = new ConcurrentDictionary<string, Dictionary<string, ParentalRating>>(StringComparer.OrdinalIgnoreCase); + private readonly IFileSystem _fileSystem; + /// <summary> /// Initializes a new instance of the <see cref="LocalizationManager"/> class. /// </summary> /// <param name="configurationManager">The configuration manager.</param> - public LocalizationManager(IServerConfigurationManager configurationManager) + public LocalizationManager(IServerConfigurationManager configurationManager, IFileSystem fileSystem) { _configurationManager = configurationManager; + _fileSystem = fileSystem; ExtractAll(); } @@ -65,7 +70,7 @@ namespace MediaBrowser.Server.Implementations.Localization { using (var stream = type.Assembly.GetManifestResourceStream(resource)) { - using (var fs = new FileStream(Path.Combine(localizationPath, filename), FileMode.Create, FileAccess.Write, FileShare.Read)) + using (var fs = _fileSystem.GetFileStream(Path.Combine(localizationPath, filename), FileMode.Create, FileAccess.Write, FileShare.Read)) { stream.CopyTo(fs); } |
