Merge pull request #2109 from Bond-009/plugin
Fix plugin installation and correct api behaviour
This commit is contained in:
commit
96a5dda9ff
|
@ -141,8 +141,7 @@ namespace Emby.Server.Implementations.Updates
|
|||
|
||||
if (guid != Guid.Empty)
|
||||
{
|
||||
var strGuid = guid.ToString("N", CultureInfo.InvariantCulture);
|
||||
availablePackages = availablePackages.Where(x => x.guid.Equals(strGuid, StringComparison.OrdinalIgnoreCase));
|
||||
availablePackages = availablePackages.Where(x => Guid.Parse(x.guid) == guid);
|
||||
}
|
||||
|
||||
return availablePackages;
|
||||
|
|
|
@ -136,10 +136,11 @@ namespace MediaBrowser.Api
|
|||
/// <returns>System.Object.</returns>
|
||||
public object Get(GetPackage request)
|
||||
{
|
||||
var packages = _installationManager.GetAvailablePackages().Result;
|
||||
|
||||
var result = packages.FirstOrDefault(p => string.Equals(p.guid, request.AssemblyGuid ?? "none", StringComparison.OrdinalIgnoreCase))
|
||||
?? packages.FirstOrDefault(p => p.name.Equals(request.Name, StringComparison.OrdinalIgnoreCase));
|
||||
var packages = _installationManager.GetAvailablePackages().GetAwaiter().GetResult();
|
||||
var result = _installationManager.FilterPackages(
|
||||
packages,
|
||||
request.Name,
|
||||
string.IsNullOrEmpty(request.AssemblyGuid) ? default : Guid.Parse(request.AssemblyGuid)).FirstOrDefault();
|
||||
|
||||
return ToOptimizedResult(result);
|
||||
}
|
||||
|
@ -184,7 +185,7 @@ namespace MediaBrowser.Api
|
|||
var package = _installationManager.GetCompatibleVersions(
|
||||
packages,
|
||||
request.Name,
|
||||
new Guid(request.AssemblyGuid),
|
||||
string.IsNullOrEmpty(request.AssemblyGuid) ? Guid.Empty : Guid.Parse(request.AssemblyGuid),
|
||||
string.IsNullOrEmpty(request.Version) ? null : Version.Parse(request.Version),
|
||||
request.UpdateClass).FirstOrDefault();
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user