Minor improvements
This commit is contained in:
parent
5eaf5465a5
commit
7243689215
|
@ -279,12 +279,7 @@ namespace Emby.Server.Implementations.Updates
|
|||
var package = availablePackages.FirstOrDefault(p => string.Equals(p.guid, guid ?? "none", StringComparison.OrdinalIgnoreCase))
|
||||
?? availablePackages.FirstOrDefault(p => p.name.Equals(name, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
if (package == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return package.versions
|
||||
return package?.versions
|
||||
.OrderByDescending(x => x.Version)
|
||||
.FirstOrDefault(v => v.classification <= classification && IsPackageVersionUpToDate(v, currentServerVersion));
|
||||
}
|
||||
|
@ -308,7 +303,6 @@ namespace Emby.Server.Implementations.Updates
|
|||
var latestPluginInfo = GetLatestCompatibleVersion(catalog, p.Name, p.Id.ToString(), applicationVersion, systemUpdateLevel);
|
||||
|
||||
return latestPluginInfo != null && latestPluginInfo.Version > p.Version ? latestPluginInfo : null;
|
||||
|
||||
}).Where(i => i != null)
|
||||
.Where(p => !string.IsNullOrEmpty(p.sourceUrl) && !CompletedInstallations.Any(i => string.Equals(i.AssemblyGuid, p.guid, StringComparison.OrdinalIgnoreCase)));
|
||||
}
|
||||
|
|
|
@ -197,7 +197,7 @@ namespace MediaBrowser.Api
|
|||
throw new ResourceNotFoundException(string.Format("Package not found: {0}", request.Name));
|
||||
}
|
||||
|
||||
await _installationManager.InstallPackage(package, CancellationToken.None);
|
||||
await _installationManager.InstallPackage(package);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -99,7 +99,7 @@ namespace MediaBrowser.Common.Updates
|
|||
/// <param name="package">The package.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns><see cref="Task" />.</returns>
|
||||
Task InstallPackage(PackageVersionInfo package, CancellationToken cancellationToken);
|
||||
Task InstallPackage(PackageVersionInfo package, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>
|
||||
/// Uninstalls a plugin
|
||||
|
|
Loading…
Reference in New Issue
Block a user