diff options
| author | Anthony Lavado <anthony@lavado.ca> | 2020-09-07 19:39:55 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-07 19:39:55 -0400 |
| commit | cc6b03296ac5fea4c90d8e36f00a599c45d43a8d (patch) | |
| tree | 4128f2bbdf5bccb1929eb0638b67920b3a8e6903 /Emby.Server.Implementations/Updates/InstallationManager.cs | |
| parent | 3aee3380668082200726dc117c8f5960a5d783bf (diff) | |
| parent | b035a642d27ea4b0a22e9a539c641a055bac056b (diff) | |
Merge pull request #3899 from crobibero/plugin-install
Install specific plugin version if requested
Diffstat (limited to 'Emby.Server.Implementations/Updates/InstallationManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/Updates/InstallationManager.cs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.cs index f121a3493..e19158f8e 100644 --- a/Emby.Server.Implementations/Updates/InstallationManager.cs +++ b/Emby.Server.Implementations/Updates/InstallationManager.cs @@ -183,7 +183,8 @@ namespace Emby.Server.Implementations.Updates IEnumerable<PackageInfo> availablePackages, string name = null, Guid guid = default, - Version minVersion = null) + Version minVersion = null, + Version specificVersion = null) { var package = FilterPackages(availablePackages, name, guid).FirstOrDefault(); @@ -197,7 +198,11 @@ namespace Emby.Server.Implementations.Updates var availableVersions = package.versions .Where(x => Version.Parse(x.targetAbi) <= appVer); - if (minVersion != null) + if (specificVersion != null) + { + availableVersions = availableVersions.Where(x => new Version(x.version) == specificVersion); + } + else if (minVersion != null) { availableVersions = availableVersions.Where(x => new Version(x.version) >= minVersion); } @@ -227,8 +232,8 @@ namespace Emby.Server.Implementations.Updates { foreach (var plugin in _applicationHost.Plugins) { - var compatibleversions = GetCompatibleVersions(pluginCatalog, plugin.Name, plugin.Id, plugin.Version); - var version = compatibleversions.FirstOrDefault(y => y.Version > plugin.Version); + 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.Guid != version.Guid)) { yield return version; |
