mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-03 06:18:28 +01:00
isolated DotNetZip dependancy
This commit is contained in:
@@ -15,6 +15,7 @@ using MediaBrowser.Controller.ScheduledTasks;
|
||||
using MediaBrowser.Controller.Updates;
|
||||
using MediaBrowser.Controller.Weather;
|
||||
using MediaBrowser.Model.Configuration;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -297,13 +298,20 @@ namespace MediaBrowser.Controller
|
||||
get { return 7359; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the zip client.
|
||||
/// </summary>
|
||||
/// <value>The zip client.</value>
|
||||
private IZipClient ZipClient { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a kernel based on a Data path, which is akin to our current programdata path
|
||||
/// </summary>
|
||||
public Kernel(IIsoManager isoManager)
|
||||
public Kernel(IIsoManager isoManager, IZipClient zipClient)
|
||||
: base(isoManager)
|
||||
{
|
||||
Instance = this;
|
||||
ZipClient = zipClient;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -319,10 +327,10 @@ namespace MediaBrowser.Controller
|
||||
RootFolder = null;
|
||||
|
||||
ReloadResourcePools();
|
||||
InstallationManager = new InstallationManager(this);
|
||||
InstallationManager = new InstallationManager(this, ZipClient);
|
||||
LibraryManager = new LibraryManager(this);
|
||||
UserManager = new UserManager(this);
|
||||
FFMpegManager = new FFMpegManager(this);
|
||||
FFMpegManager = new FFMpegManager(this, ZipClient);
|
||||
ImageManager = new ImageManager(this);
|
||||
ProviderManager = new ProviderManager(this);
|
||||
UserDataManager = new UserDataManager(this);
|
||||
|
||||
@@ -53,9 +53,6 @@
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Ionic.Zip">
|
||||
<HintPath>..\packages\DotNetZip.1.9.1.8\lib\net20\Ionic.Zip.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Mediabrowser.PluginSecurity">
|
||||
<HintPath>Plugins\Mediabrowser.PluginSecurity.dll</HintPath>
|
||||
</Reference>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Ionic.Zip;
|
||||
using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Common.Extensions;
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Common.Kernel;
|
||||
using MediaBrowser.Common.Serialization;
|
||||
@@ -7,6 +6,7 @@ using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.Audio;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.IO;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
@@ -58,14 +58,29 @@ namespace MediaBrowser.Controller.MediaInfo
|
||||
/// </summary>
|
||||
/// <value>The subtitle cache.</value>
|
||||
internal FileSystemRepository SubtitleCache { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the zip client.
|
||||
/// </summary>
|
||||
/// <value>The zip client.</value>
|
||||
private IZipClient ZipClient { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FFMpegManager" /> class.
|
||||
/// </summary>
|
||||
/// <param name="kernel">The kernel.</param>
|
||||
public FFMpegManager(Kernel kernel)
|
||||
/// <param name="zipClient">The zip client.</param>
|
||||
/// <exception cref="System.ArgumentNullException">zipClient</exception>
|
||||
public FFMpegManager(Kernel kernel, IZipClient zipClient)
|
||||
: base(kernel)
|
||||
{
|
||||
if (zipClient == null)
|
||||
{
|
||||
throw new ArgumentNullException("zipClient");
|
||||
}
|
||||
|
||||
ZipClient = zipClient;
|
||||
|
||||
// Not crazy about this but it's the only way to suppress ffmpeg crash dialog boxes
|
||||
SetErrorMode(ErrorModes.SEM_FAILCRITICALERRORS | ErrorModes.SEM_NOALIGNMENTFAULTEXCEPT | ErrorModes.SEM_NOGPFAULTERRORBOX | ErrorModes.SEM_NOOPENFILEERRORBOX);
|
||||
|
||||
@@ -352,10 +367,7 @@ namespace MediaBrowser.Controller.MediaInfo
|
||||
{
|
||||
using (var resourceStream = assembly.GetManifestResourceStream(zipFileResourcePath))
|
||||
{
|
||||
using (var zipFile = ZipFile.Read(resourceStream))
|
||||
{
|
||||
zipFile.ExtractAll(targetPath, ExtractExistingFileAction.DoNotOverwrite);
|
||||
}
|
||||
ZipClient.ExtractAll(resourceStream, targetPath, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -383,7 +395,7 @@ namespace MediaBrowser.Controller.MediaInfo
|
||||
{
|
||||
return "-probesize 1G -analyzeduration 200M";
|
||||
}
|
||||
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
@@ -818,7 +830,7 @@ namespace MediaBrowser.Controller.MediaInfo
|
||||
{
|
||||
throw new ArgumentException("The given MediaStream is not an external subtitle stream");
|
||||
}
|
||||
|
||||
|
||||
var process = new Process
|
||||
{
|
||||
StartInfo = new ProcessStartInfo
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
using System.Security.Cryptography;
|
||||
using Ionic.Zip;
|
||||
using MediaBrowser.Common.Events;
|
||||
using MediaBrowser.Common.Kernel;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Common.Plugins;
|
||||
using MediaBrowser.Common.Progress;
|
||||
using MediaBrowser.Common.Serialization;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Updates;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
@@ -91,14 +91,27 @@ namespace MediaBrowser.Controller.Updates
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the zip client.
|
||||
/// </summary>
|
||||
/// <value>The zip client.</value>
|
||||
private IZipClient ZipClient { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InstallationManager" /> class.
|
||||
/// </summary>
|
||||
/// <param name="kernel">The kernel.</param>
|
||||
public InstallationManager(Kernel kernel)
|
||||
/// <param name="zipClient">The zip client.</param>
|
||||
/// <exception cref="System.ArgumentNullException">zipClient</exception>
|
||||
public InstallationManager(Kernel kernel, IZipClient zipClient)
|
||||
: base(kernel)
|
||||
{
|
||||
if (zipClient == null)
|
||||
{
|
||||
throw new ArgumentNullException("zipClient");
|
||||
}
|
||||
|
||||
ZipClient = zipClient;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -391,11 +404,7 @@ namespace MediaBrowser.Controller.Updates
|
||||
{
|
||||
try
|
||||
{
|
||||
// Extract to target in full - overwriting
|
||||
using (var zipFile = ZipFile.Read(tempFile))
|
||||
{
|
||||
zipFile.ExtractAll(target, ExtractExistingFileAction.OverwriteSilently);
|
||||
}
|
||||
ZipClient.ExtractAll(tempFile, target, true);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="DotNetZip" version="1.9.1.8" targetFramework="net45" />
|
||||
<package id="morelinq" version="1.0.15631-beta" targetFramework="net45" />
|
||||
<package id="protobuf-net" version="2.0.0.621" targetFramework="net45" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user