mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-05 21:37:10 -04:00
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))
|
var package = availablePackages.FirstOrDefault(p => string.Equals(p.guid, guid ?? "none", StringComparison.OrdinalIgnoreCase))
|
||||||
?? availablePackages.FirstOrDefault(p => p.name.Equals(name, StringComparison.OrdinalIgnoreCase));
|
?? availablePackages.FirstOrDefault(p => p.name.Equals(name, StringComparison.OrdinalIgnoreCase));
|
||||||
|
|
||||||
if (package == null)
|
return package?.versions
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return package.versions
|
|
||||||
.OrderByDescending(x => x.Version)
|
.OrderByDescending(x => x.Version)
|
||||||
.FirstOrDefault(v => v.classification <= classification && IsPackageVersionUpToDate(v, currentServerVersion));
|
.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);
|
var latestPluginInfo = GetLatestCompatibleVersion(catalog, p.Name, p.Id.ToString(), applicationVersion, systemUpdateLevel);
|
||||||
|
|
||||||
return latestPluginInfo != null && latestPluginInfo.Version > p.Version ? latestPluginInfo : null;
|
return latestPluginInfo != null && latestPluginInfo.Version > p.Version ? latestPluginInfo : null;
|
||||||
|
|
||||||
}).Where(i => i != null)
|
}).Where(i => i != null)
|
||||||
.Where(p => !string.IsNullOrEmpty(p.sourceUrl) && !CompletedInstallations.Any(i => string.Equals(i.AssemblyGuid, p.guid, StringComparison.OrdinalIgnoreCase)));
|
.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));
|
throw new ResourceNotFoundException(string.Format("Package not found: {0}", request.Name));
|
||||||
}
|
}
|
||||||
|
|
||||||
await _installationManager.InstallPackage(package, CancellationToken.None);
|
await _installationManager.InstallPackage(package);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -99,7 +99,7 @@ namespace MediaBrowser.Common.Updates
|
|||||||
/// <param name="package">The package.</param>
|
/// <param name="package">The package.</param>
|
||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns><see cref="Task" />.</returns>
|
/// <returns><see cref="Task" />.</returns>
|
||||||
Task InstallPackage(PackageVersionInfo package, CancellationToken cancellationToken);
|
Task InstallPackage(PackageVersionInfo package, CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Uninstalls a plugin
|
/// Uninstalls a plugin
|
||||||
|
Loading…
Reference in New Issue
Block a user