From a4565da4a998cfaa5bb8ff9d96d3d62b25574a90 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Sat, 18 Dec 2021 17:49:33 +0100 Subject: Use System.IO.Compression instead of SharpCompress for zips Also removes unused methods from ZipClient --- Emby.Server.Implementations/Updates/InstallationManager.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'Emby.Server.Implementations/Updates') diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.cs index ef95ebf94..7f7eec7d9 100644 --- a/Emby.Server.Implementations/Updates/InstallationManager.cs +++ b/Emby.Server.Implementations/Updates/InstallationManager.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.IO; +using System.IO.Compression; using System.Linq; using System.Net.Http; using System.Net.Http.Json; @@ -47,7 +48,6 @@ namespace Emby.Server.Implementations.Updates /// /// The application host. private readonly IServerApplicationHost _applicationHost; - private readonly IZipClient _zipClient; private readonly object _currentInstallationsLock = new object(); /// @@ -69,7 +69,6 @@ namespace Emby.Server.Implementations.Updates /// The . /// The . /// The . - /// The . /// The . public InstallationManager( ILogger logger, @@ -78,7 +77,6 @@ namespace Emby.Server.Implementations.Updates IEventManager eventManager, IHttpClientFactory httpClientFactory, IServerConfigurationManager config, - IZipClient zipClient, IPluginManager pluginManager) { _currentInstallations = new List<(InstallationInfo, CancellationTokenSource)>(); @@ -90,7 +88,6 @@ namespace Emby.Server.Implementations.Updates _eventManager = eventManager; _httpClientFactory = httpClientFactory; _config = config; - _zipClient = zipClient; _jsonSerializerOptions = JsonDefaults.Options; _pluginManager = pluginManager; } @@ -560,7 +557,8 @@ namespace Emby.Server.Implementations.Updates } stream.Position = 0; - _zipClient.ExtractAllFromZip(stream, targetDir, true); + using var reader = new ZipArchive(stream); + reader.ExtractToDirectory(targetDir, true); await _pluginManager.GenerateManifest(package.PackageInfo, package.Version, targetDir, status).ConfigureAwait(false); _pluginManager.ImportPluginFrom(targetDir); } -- cgit v1.2.3