aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Archiving
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-09-25 01:06:15 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-09-25 01:06:15 -0400
commit978eedbcb7a778248acd03b7f924260db70cd406 (patch)
tree034fcf627081d6b0f5b60c62e5147127de438371 /Emby.Server.Implementations/Archiving
parent768f20b1bbc16c9f0eb013a486d472dc7d2684a2 (diff)
improve support for compressed xmltv
Diffstat (limited to 'Emby.Server.Implementations/Archiving')
-rw-r--r--Emby.Server.Implementations/Archiving/ZipClient.cs17
1 files changed, 17 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/Archiving/ZipClient.cs b/Emby.Server.Implementations/Archiving/ZipClient.cs
index 3218d56c63..d7d37bb61c 100644
--- a/Emby.Server.Implementations/Archiving/ZipClient.cs
+++ b/Emby.Server.Implementations/Archiving/ZipClient.cs
@@ -4,6 +4,7 @@ using SharpCompress.Archives.Rar;
using SharpCompress.Archives.SevenZip;
using SharpCompress.Archives.Tar;
using SharpCompress.Readers;
+using SharpCompress.Readers.GZip;
using SharpCompress.Readers.Zip;
namespace Emby.Server.Implementations.Archiving
@@ -72,6 +73,22 @@ namespace Emby.Server.Implementations.Archiving
}
}
+ public void ExtractAllFromGz(Stream source, string targetPath, bool overwriteExistingFiles)
+ {
+ using (var reader = GZipReader.Open(source))
+ {
+ var options = new ExtractionOptions();
+ options.ExtractFullPath = true;
+
+ if (overwriteExistingFiles)
+ {
+ options.Overwrite = true;
+ }
+
+ reader.WriteAllToDirectory(targetPath, options);
+ }
+ }
+
/// <summary>
/// Extracts all from7z.
/// </summary>