diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-09-25 01:06:15 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-09-25 01:06:15 -0400 |
| commit | 978eedbcb7a778248acd03b7f924260db70cd406 (patch) | |
| tree | 034fcf627081d6b0f5b60c62e5147127de438371 /Emby.Server.Implementations/Archiving/ZipClient.cs | |
| parent | 768f20b1bbc16c9f0eb013a486d472dc7d2684a2 (diff) | |
improve support for compressed xmltv
Diffstat (limited to 'Emby.Server.Implementations/Archiving/ZipClient.cs')
| -rw-r--r-- | Emby.Server.Implementations/Archiving/ZipClient.cs | 17 |
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> |
