diff options
| author | cvium <clausvium@gmail.com> | 2021-09-10 11:40:28 +0200 |
|---|---|---|
| committer | cvium <clausvium@gmail.com> | 2021-09-10 11:40:28 +0200 |
| commit | 8496d7638ab7823169c220b615289c401cefa9a0 (patch) | |
| tree | 66134cb10250319dc4be0dc8abf6b2a6573e4cbf /Jellyfin.Api/Controllers/PluginsController.cs | |
| parent | fb7587dd84784afb7c64aadf1fc2d0bab5251814 (diff) | |
| parent | b96dbbf553820861eab9d1a453adcc8ce8a9ef05 (diff) | |
Merge branch 'master' into NetworkAccessPolicy
Diffstat (limited to 'Jellyfin.Api/Controllers/PluginsController.cs')
| -rw-r--r-- | Jellyfin.Api/Controllers/PluginsController.cs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/Jellyfin.Api/Controllers/PluginsController.cs b/Jellyfin.Api/Controllers/PluginsController.cs index 24285bfb9..0ae6109bc 100644 --- a/Jellyfin.Api/Controllers/PluginsController.cs +++ b/Jellyfin.Api/Controllers/PluginsController.cs @@ -8,11 +8,10 @@ using System.Threading.Tasks; using Jellyfin.Api.Attributes; using Jellyfin.Api.Constants; using Jellyfin.Api.Models.PluginDtos; +using Jellyfin.Extensions.Json; using MediaBrowser.Common.Configuration; -using MediaBrowser.Common.Json; using MediaBrowser.Common.Plugins; using MediaBrowser.Common.Updates; -using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Net; using MediaBrowser.Model.Plugins; using Microsoft.AspNetCore.Authorization; @@ -208,12 +207,7 @@ namespace Jellyfin.Api.Controllers var plugins = _pluginManager.Plugins.Where(p => p.Id.Equals(pluginId)); // Select the un-instanced one first. - var plugin = plugins.FirstOrDefault(p => p.Instance == null); - if (plugin == null) - { - // Then by the status. - plugin = plugins.OrderBy(p => p.Manifest.Status).FirstOrDefault(); - } + var plugin = plugins.FirstOrDefault(p => p.Instance == null) ?? plugins.OrderBy(p => p.Manifest.Status).FirstOrDefault(); if (plugin != null) { |
