apply code suggestions

Co-authored-by: Vasily <JustAMan@users.noreply.github.com>
Co-authored-by: Cody Robibero <cody@robibe.ro>
This commit is contained in:
dkanada 2020-06-03 15:24:17 +09:00 committed by GitHub
parent deafe59b7e
commit 6a7cb21b7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -204,12 +204,11 @@ namespace Emby.Server.Implementations.Updates
if (minVersion != null) if (minVersion != null)
{ {
availableVersions = availableVersions availableVersions = availableVersions.Where(x => new Version(x.version) >= minVersion);
.Where(x => new Version(x.version) >= minVersion)
.OrderByDescending(x => x.version);
} }
foreach (var v in availableVersions) foreach (var v in availableVersions.OrderByDescending(x => x.version))
)
{ {
yield return new InstallationInfo yield return new InstallationInfo
{ {
@ -331,13 +330,13 @@ namespace Emby.Server.Implementations.Updates
// Do plugin-specific processing // Do plugin-specific processing
if (plugin == null) if (plugin == null)
{ {
_logger.LogInformation("New plugin installed: {0} {1} {2}", package.Name, package.Version); _logger.LogInformation("New plugin installed: {0} {1}", package.Name, package.Version);
PluginInstalled?.Invoke(this, package); PluginInstalled?.Invoke(this, package);
} }
else else
{ {
_logger.LogInformation("Plugin updated: {0} {1} {2}", package.Name, package.Version); _logger.LogInformation("Plugin updated: {0} {1}", package.Name, package.Version);
PluginUpdated?.Invoke(this, package); PluginUpdated?.Invoke(this, package);
} }