mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-07 00:08:29 +01:00
isolated DotNetZip dependancy
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Common.Kernel;
|
||||
using MediaBrowser.Common.Kernel;
|
||||
using MediaBrowser.Common.UI;
|
||||
using MediaBrowser.Controller;
|
||||
using MediaBrowser.IsoMounter;
|
||||
using MediaBrowser.Server.Uninstall;
|
||||
using MediaBrowser.ServerApplication.Implementations;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
|
||||
@@ -170,7 +169,7 @@ namespace MediaBrowser.ServerApplication
|
||||
/// <returns>IKernel.</returns>
|
||||
protected override IKernel InstantiateKernel()
|
||||
{
|
||||
return new Kernel(new PismoIsoManager());
|
||||
return new Kernel(new PismoIsoManager(), new DotNetZipClient());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
using Ionic.Zip;
|
||||
using MediaBrowser.Model.IO;
|
||||
using System.IO;
|
||||
|
||||
namespace MediaBrowser.ServerApplication.Implementations
|
||||
{
|
||||
/// <summary>
|
||||
/// Class DotNetZipClient
|
||||
/// </summary>
|
||||
public class DotNetZipClient : IZipClient
|
||||
{
|
||||
/// <summary>
|
||||
/// Extracts all.
|
||||
/// </summary>
|
||||
/// <param name="sourceFile">The source file.</param>
|
||||
/// <param name="targetPath">The target path.</param>
|
||||
/// <param name="overwriteExistingFiles">if set to <c>true</c> [overwrite existing files].</param>
|
||||
public void ExtractAll(string sourceFile, string targetPath, bool overwriteExistingFiles)
|
||||
{
|
||||
using (var fileStream = File.OpenRead(sourceFile))
|
||||
{
|
||||
using (var zipFile = ZipFile.Read(fileStream))
|
||||
{
|
||||
zipFile.ExtractAll(targetPath, overwriteExistingFiles ? ExtractExistingFileAction.OverwriteSilently : ExtractExistingFileAction.DoNotOverwrite);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Extracts all.
|
||||
/// </summary>
|
||||
/// <param name="source">The source.</param>
|
||||
/// <param name="targetPath">The target path.</param>
|
||||
/// <param name="overwriteExistingFiles">if set to <c>true</c> [overwrite existing files].</param>
|
||||
public void ExtractAll(Stream source, string targetPath, bool overwriteExistingFiles)
|
||||
{
|
||||
using (var zipFile = ZipFile.Read(source))
|
||||
{
|
||||
zipFile.ExtractAll(targetPath, overwriteExistingFiles ? ExtractExistingFileAction.OverwriteSilently : ExtractExistingFileAction.DoNotOverwrite);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -115,6 +115,10 @@
|
||||
<Reference Include="Hardcodet.Wpf.TaskbarNotification">
|
||||
<HintPath>..\packages\Hardcodet.Wpf.TaskbarNotification.1.0.4.0\lib\net40\Hardcodet.Wpf.TaskbarNotification.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\DotNetZip.1.9.1.8\lib\net20\Ionic.Zip.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Platinum.Managed, Version=1.0.4794.22684, Culture=neutral, processorArchitecture=x86">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\ThirdParty\UPnP\Libs\Platinum.Managed.dll</HintPath>
|
||||
@@ -175,6 +179,7 @@
|
||||
<Compile Include="Controls\MultiItemUpdateNotification.xaml.cs">
|
||||
<DependentUpon>MultiItemUpdateNotification.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Implementations\DotNetZipClient.cs" />
|
||||
<Compile Include="LibraryExplorer.xaml.cs">
|
||||
<DependentUpon>LibraryExplorer.xaml</DependentUpon>
|
||||
</Compile>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="DotNetZip" version="1.9.1.8" targetFramework="net45" />
|
||||
<package id="Hardcodet.Wpf.TaskbarNotification" version="1.0.4.0" targetFramework="net45" />
|
||||
<package id="System.Data.SQLite" version="1.0.84.0" targetFramework="net45" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user