aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Updates
diff options
context:
space:
mode:
authorcrobibero <cody@robibe.ro>2020-08-14 08:54:21 -0600
committercrobibero <cody@robibe.ro>2020-08-14 08:54:21 -0600
commit5e6cdc8842c3c81eb7e0363e6d36fac6630304e1 (patch)
treeb674b5b977e847c0b7f9bd2d573e727e031f7437 /Emby.Server.Implementations/Updates
parent42a9feb2f3b6bb38144779a5b90e0e2334fb40e2 (diff)
Install specific plugin version if requested
Diffstat (limited to 'Emby.Server.Implementations/Updates')
-rw-r--r--Emby.Server.Implementations/Updates/InstallationManager.cs13
1 files changed, 9 insertions, 4 deletions
diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.cs
index 4f54c06dd..8d0c4c350 100644
--- a/Emby.Server.Implementations/Updates/InstallationManager.cs
+++ b/Emby.Server.Implementations/Updates/InstallationManager.cs
@@ -191,7 +191,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();
@@ -205,7 +206,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);
}
@@ -235,8 +240,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;