aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Updates/InstallationManager.cs
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2022-12-05 15:01:13 +0100
committerBond_009 <bond.009@outlook.com>2022-12-05 15:01:13 +0100
commit52194f56b5f07e3ae01e2fb6d121452e37d1e93f (patch)
treefd638972f72ec49734ad07f831a3aae3b2501a1d /Emby.Server.Implementations/Updates/InstallationManager.cs
parentc7d50d640e614a3c13699e3041fbfcb258861c5a (diff)
Replace != null with is not null
Diffstat (limited to 'Emby.Server.Implementations/Updates/InstallationManager.cs')
-rw-r--r--Emby.Server.Implementations/Updates/InstallationManager.cs18
1 files changed, 9 insertions, 9 deletions
diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.cs
index 84489b646..5e897833e 100644
--- a/Emby.Server.Implementations/Updates/InstallationManager.cs
+++ b/Emby.Server.Implementations/Updates/InstallationManager.cs
@@ -168,7 +168,7 @@ namespace Emby.Server.Implementations.Updates
var result = new List<PackageInfo>();
foreach (RepositoryInfo repository in _config.Configuration.PluginRepositories)
{
- if (repository.Enabled && repository.Url != null)
+ if (repository.Enabled && repository.Url is not null)
{
// Where repositories have the same content, the details from the first is taken.
foreach (var package in await GetPackages(repository.Name ?? "Unnamed Repo", repository.Url, true, cancellationToken).ConfigureAwait(true))
@@ -181,7 +181,7 @@ namespace Emby.Server.Implementations.Updates
var version = package.Versions[i];
var plugin = _pluginManager.GetPlugin(package.Id, version.VersionNumber);
- if (plugin != null)
+ if (plugin is not null)
{
await _pluginManager.GenerateManifest(package, version.VersionNumber, plugin.Path, plugin.Manifest.Status).ConfigureAwait(false);
}
@@ -199,7 +199,7 @@ namespace Emby.Server.Implementations.Updates
continue;
}
- if (existing != null)
+ if (existing is not null)
{
// Assumption is both lists are ordered, so slot these into the correct place.
MergeSortedList(existing.Versions, package.Versions);
@@ -222,7 +222,7 @@ namespace Emby.Server.Implementations.Updates
Guid id = default,
Version? specificVersion = null)
{
- if (name != null)
+ if (name is not null)
{
availablePackages = availablePackages.Where(x => x.Name.Equals(name, StringComparison.OrdinalIgnoreCase));
}
@@ -232,7 +232,7 @@ namespace Emby.Server.Implementations.Updates
availablePackages = availablePackages.Where(x => x.Id.Equals(id));
}
- if (specificVersion != null)
+ if (specificVersion is not null)
{
availablePackages = availablePackages.Where(x => x.Versions.Any(y => y.VersionNumber.Equals(specificVersion)));
}
@@ -260,11 +260,11 @@ namespace Emby.Server.Implementations.Updates
var availableVersions = package.Versions
.Where(x => string.IsNullOrEmpty(x.TargetAbi) || Version.Parse(x.TargetAbi) <= appVer);
- if (specificVersion != null)
+ if (specificVersion is not null)
{
availableVersions = availableVersions.Where(x => x.VersionNumber.Equals(specificVersion));
}
- else if (minVersion != null)
+ else if (minVersion is not null)
{
availableVersions = availableVersions.Where(x => x.VersionNumber >= minVersion);
}
@@ -495,7 +495,7 @@ namespace Emby.Server.Implementations.Updates
var compatibleVersions = GetCompatibleVersions(pluginCatalog, plugin.Name, plugin.Id, minVersion: plugin.Version);
var version = compatibleVersions.FirstOrDefault(y => y.Version > plugin.Version);
- if (version != null && CompletedInstallations.All(x => !x.Id.Equals(version.Id)))
+ if (version is not null && CompletedInstallations.All(x => !x.Id.Equals(version.Id)))
{
yield return version;
}
@@ -567,7 +567,7 @@ namespace Emby.Server.Implementations.Updates
await PerformPackageInstallation(package, plugin?.Manifest.Status ?? PluginStatus.Active, cancellationToken).ConfigureAwait(false);
_logger.LogInformation("Plugin {Action}: {PluginName} {PluginVersion}", plugin is null ? "installed" : "updated", package.Name, package.Version);
- return plugin != null;
+ return plugin is not null;
}
}
}