diff options
| author | Mark Monteiro <marknr.monteiro@protonmail.com> | 2020-04-06 22:04:24 -0400 |
|---|---|---|
| committer | Mark Monteiro <marknr.monteiro@protonmail.com> | 2020-04-06 22:04:24 -0400 |
| commit | 8e3b09a996bb2bc768a1a9d93f77de02606df736 (patch) | |
| tree | bdd9a6de3c1e80c6aad0b3943be24cb8c5aacb6f /Emby.Server.Implementations/Updates | |
| parent | 0cd7cd611e6118b8dac31cf3c6861509f2b33c56 (diff) | |
Do not use IAsyncEnumerable unnecessarily
Diffstat (limited to 'Emby.Server.Implementations/Updates')
| -rw-r--r-- | Emby.Server.Implementations/Updates/InstallationManager.cs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.cs index c897036eb..7649779f1 100644 --- a/Emby.Server.Implementations/Updates/InstallationManager.cs +++ b/Emby.Server.Implementations/Updates/InstallationManager.cs @@ -189,16 +189,17 @@ namespace Emby.Server.Implementations.Updates } /// <inheritdoc /> - public async IAsyncEnumerable<PackageVersionInfo> GetAvailablePluginUpdates([EnumeratorCancellation] CancellationToken cancellationToken = default) + public async Task<IEnumerable<PackageVersionInfo>> GetAvailablePluginUpdates(CancellationToken cancellationToken = default) { var catalog = await GetAvailablePackages(cancellationToken).ConfigureAwait(false); + return GetAvailablePluginUpdates(catalog); + } - var systemUpdateLevel = _applicationHost.SystemUpdateLevel; - - // Figure out what needs to be installed + private IEnumerable<PackageVersionInfo> GetAvailablePluginUpdates(IReadOnlyList<PackageInfo> pluginCatalog) + { foreach (var plugin in _applicationHost.Plugins) { - var compatibleversions = GetCompatibleVersions(catalog, plugin.Name, plugin.Id, plugin.Version, systemUpdateLevel); + var compatibleversions = GetCompatibleVersions(pluginCatalog, plugin.Name, plugin.Id, plugin.Version, _applicationHost.SystemUpdateLevel); var version = compatibleversions.FirstOrDefault(y => y.Version > plugin.Version); if (version != null && !CompletedInstallations.Any(x => string.Equals(x.AssemblyGuid, version.guid, StringComparison.OrdinalIgnoreCase))) |
