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)
|
if (guid != Guid.Empty)
|
||||||
{
|
{
|
||||||
var strGuid = guid.ToString("N", CultureInfo.InvariantCulture);
|
availablePackages = availablePackages.Where(x => Guid.Parse(x.guid) == guid);
|
||||||
availablePackages = availablePackages.Where(x => x.guid.Equals(strGuid, StringComparison.OrdinalIgnoreCase));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return availablePackages;
|
return availablePackages;
|
||||||
|
|
|
@ -136,10 +136,11 @@ namespace MediaBrowser.Api
|
||||||
/// <returns>System.Object.</returns>
|
/// <returns>System.Object.</returns>
|
||||||
public object Get(GetPackage request)
|
public object Get(GetPackage request)
|
||||||
{
|
{
|
||||||
var packages = _installationManager.GetAvailablePackages().Result;
|
var packages = _installationManager.GetAvailablePackages().GetAwaiter().GetResult();
|
||||||
|
var result = _installationManager.FilterPackages(
|
||||||
var result = packages.FirstOrDefault(p => string.Equals(p.guid, request.AssemblyGuid ?? "none", StringComparison.OrdinalIgnoreCase))
|
packages,
|
||||||
?? packages.FirstOrDefault(p => p.name.Equals(request.Name, StringComparison.OrdinalIgnoreCase));
|
request.Name,
|
||||||
|
string.IsNullOrEmpty(request.AssemblyGuid) ? default : Guid.Parse(request.AssemblyGuid)).FirstOrDefault();
|
||||||
|
|
||||||
return ToOptimizedResult(result);
|
return ToOptimizedResult(result);
|
||||||
}
|
}
|
||||||
|
@ -184,7 +185,7 @@ namespace MediaBrowser.Api
|
||||||
var package = _installationManager.GetCompatibleVersions(
|
var package = _installationManager.GetCompatibleVersions(
|
||||||
packages,
|
packages,
|
||||||
request.Name,
|
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),
|
string.IsNullOrEmpty(request.Version) ? null : Version.Parse(request.Version),
|
||||||
request.UpdateClass).FirstOrDefault();
|
request.UpdateClass).FirstOrDefault();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user