From 2bf4f29f2883e2a6fe624eab9144e7bd57246c2c Mon Sep 17 00:00:00 2001 From: nilaoda Date: Sun, 20 Oct 2024 12:39:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DGzip=E8=A7=A3=E5=8E=8B?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E6=96=87=E4=BB=B6=E6=89=BE=E4=B8=8D=E5=88=B0?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20(#465)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/N_m3u8DL-RE/Util/OtherUtil.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/N_m3u8DL-RE/Util/OtherUtil.cs b/src/N_m3u8DL-RE/Util/OtherUtil.cs index 1a60ca9..e8afee5 100644 --- a/src/N_m3u8DL-RE/Util/OtherUtil.cs +++ b/src/N_m3u8DL-RE/Util/OtherUtil.cs @@ -143,15 +143,13 @@ namespace N_m3u8DL_RE.Util /// public static async Task DeGzipFileAsync(string filePath) { - string deGzipFile = Path.ChangeExtension(filePath, ".tmp"); + var deGzipFile = Path.ChangeExtension(filePath, ".dezip_tmp"); try { - using (var fileToDecompressAsStream = File.OpenRead(filePath)) - { - using var decompressedStream = File.Create(deGzipFile); - using var decompressionStream = new GZipStream(fileToDecompressAsStream, CompressionMode.Decompress); - await decompressionStream.CopyToAsync(decompressedStream); - } + await using var fileToDecompressAsStream = File.OpenRead(filePath); + await using var decompressedStream = File.Create(deGzipFile); + await using var decompressionStream = new GZipStream(fileToDecompressAsStream, CompressionMode.Decompress); + await decompressionStream.CopyToAsync(decompressedStream); File.Delete(filePath); File.Move(deGzipFile, filePath); }