mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-20 17:14:42 +01:00
change zip extraction to resolve osx issue
This commit is contained in:
@@ -4,6 +4,7 @@ using SharpCompress.Archive.SevenZip;
|
||||
using SharpCompress.Archive.Tar;
|
||||
using SharpCompress.Common;
|
||||
using SharpCompress.Reader;
|
||||
using SharpCompress.Reader.Zip;
|
||||
using System.IO;
|
||||
|
||||
namespace MediaBrowser.Common.Implementations.Archiving
|
||||
@@ -48,6 +49,21 @@ namespace MediaBrowser.Common.Implementations.Archiving
|
||||
}
|
||||
}
|
||||
|
||||
public void ExtractAllFromZip(Stream source, string targetPath, bool overwriteExistingFiles)
|
||||
{
|
||||
using (var reader = ZipReader.Open(source))
|
||||
{
|
||||
var options = ExtractOptions.ExtractFullPath;
|
||||
|
||||
if (overwriteExistingFiles)
|
||||
{
|
||||
options = options | ExtractOptions.Overwrite;
|
||||
}
|
||||
|
||||
reader.WriteAllToDirectory(targetPath, options);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Extracts all from7z.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user