aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Updates
diff options
context:
space:
mode:
authorAnthony Lavado <anthonylavado@users.noreply.github.com>2019-03-27 09:53:45 -0400
committerGitHub <noreply@github.com>2019-03-27 09:53:45 -0400
commit524357bfa845e1c01ef280b1d0fc3896b7b9dbaa (patch)
treef5a194260683b1469f6d7ed1e9af644af2756c99 /Emby.Server.Implementations/Updates
parent31607fbb377c826415dc0f6689ac4189b38c840f (diff)
parent7343e07fe587b4817f5e80b68359d3193674e6ab (diff)
Merge pull request #1157 from Bond-009/smallfix
Simplify/remove/clean code
Diffstat (limited to 'Emby.Server.Implementations/Updates')
-rw-r--r--Emby.Server.Implementations/Updates/InstallationManager.cs32
1 files changed, 6 insertions, 26 deletions
diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.cs
index 301802b8a..7310de55d 100644
--- a/Emby.Server.Implementations/Updates/InstallationManager.cs
+++ b/Emby.Server.Implementations/Updates/InstallationManager.cs
@@ -12,7 +12,6 @@ using MediaBrowser.Common.Plugins;
using MediaBrowser.Common.Progress;
using MediaBrowser.Common.Updates;
using MediaBrowser.Controller.Configuration;
-using MediaBrowser.Model.Cryptography;
using MediaBrowser.Model.Events;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Serialization;
@@ -39,11 +38,10 @@ namespace Emby.Server.Implementations.Updates
/// <summary>
/// The completed installations
/// </summary>
- private ConcurrentBag<InstallationInfo> CompletedInstallationsInternal { get; set; }
+ private ConcurrentBag<InstallationInfo> _completedInstallationsInternal;
- public IEnumerable<InstallationInfo> CompletedInstallations => CompletedInstallationsInternal;
+ public IEnumerable<InstallationInfo> CompletedInstallations => _completedInstallationsInternal;
- #region PluginUninstalled Event
/// <summary>
/// Occurs when [plugin uninstalled].
/// </summary>
@@ -57,9 +55,7 @@ namespace Emby.Server.Implementations.Updates
{
PluginUninstalled?.Invoke(this, new GenericEventArgs<IPlugin> { Argument = plugin });
}
- #endregion
- #region PluginUpdated Event
/// <summary>
/// Occurs when [plugin updated].
/// </summary>
@@ -77,9 +73,7 @@ namespace Emby.Server.Implementations.Updates
_applicationHost.NotifyPendingRestart();
}
- #endregion
- #region PluginInstalled Event
/// <summary>
/// Occurs when [plugin updated].
/// </summary>
@@ -96,7 +90,6 @@ namespace Emby.Server.Implementations.Updates
_applicationHost.NotifyPendingRestart();
}
- #endregion
/// <summary>
/// The _logger
@@ -115,12 +108,8 @@ namespace Emby.Server.Implementations.Updates
/// <value>The application host.</value>
private readonly IApplicationHost _applicationHost;
- private readonly ICryptoProvider _cryptographyProvider;
private readonly IZipClient _zipClient;
- // netframework or netcore
- private readonly string _packageRuntime;
-
public InstallationManager(
ILoggerFactory loggerFactory,
IApplicationHost appHost,
@@ -129,9 +118,7 @@ namespace Emby.Server.Implementations.Updates
IJsonSerializer jsonSerializer,
IServerConfigurationManager config,
IFileSystem fileSystem,
- ICryptoProvider cryptographyProvider,
- IZipClient zipClient,
- string packageRuntime)
+ IZipClient zipClient)
{
if (loggerFactory == null)
{
@@ -139,18 +126,16 @@ namespace Emby.Server.Implementations.Updates
}
CurrentInstallations = new List<Tuple<InstallationInfo, CancellationTokenSource>>();
- CompletedInstallationsInternal = new ConcurrentBag<InstallationInfo>();
+ _completedInstallationsInternal = new ConcurrentBag<InstallationInfo>();
+ _logger = loggerFactory.CreateLogger(nameof(InstallationManager));
_applicationHost = appHost;
_appPaths = appPaths;
_httpClient = httpClient;
_jsonSerializer = jsonSerializer;
_config = config;
_fileSystem = fileSystem;
- _cryptographyProvider = cryptographyProvider;
_zipClient = zipClient;
- _packageRuntime = packageRuntime;
- _logger = loggerFactory.CreateLogger(nameof(InstallationManager));
}
private static Version GetPackageVersion(PackageVersionInfo version)
@@ -222,11 +207,6 @@ namespace Emby.Server.Implementations.Updates
continue;
}
- if (string.IsNullOrEmpty(version.runtimes) || version.runtimes.IndexOf(_packageRuntime, StringComparison.OrdinalIgnoreCase) == -1)
- {
- continue;
- }
-
versions.Add(version);
}
@@ -448,7 +428,7 @@ namespace Emby.Server.Implementations.Updates
CurrentInstallations.Remove(tuple);
}
- CompletedInstallationsInternal.Add(installationInfo);
+ _completedInstallationsInternal.Add(installationInfo);
PackageInstallationCompleted?.Invoke(this, installationEventArgs);
}