aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/PluginsController.cs
diff options
context:
space:
mode:
authorPatrick Barron <18354464+barronpm@users.noreply.github.com>2021-05-10 09:05:12 -0400
committerGitHub <noreply@github.com>2021-05-10 09:05:12 -0400
commite55f35b62e5da535bfba301e5ac86f28df35dd2e (patch)
tree02c1d449788be00877e3f53acde17638eadfc90a /Jellyfin.Api/Controllers/PluginsController.cs
parent9413d974f3f234dd3fc2225d318d7fced7257912 (diff)
parentd4a50be22c3c4b9bb0adfb957ee558287fd219d9 (diff)
Merge branch 'master' into using-declarations
Diffstat (limited to 'Jellyfin.Api/Controllers/PluginsController.cs')
-rw-r--r--Jellyfin.Api/Controllers/PluginsController.cs10
1 files changed, 2 insertions, 8 deletions
diff --git a/Jellyfin.Api/Controllers/PluginsController.cs b/Jellyfin.Api/Controllers/PluginsController.cs
index a5aa9bfca..7a6130719 100644
--- a/Jellyfin.Api/Controllers/PluginsController.cs
+++ b/Jellyfin.Api/Controllers/PluginsController.cs
@@ -12,7 +12,6 @@ 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;
@@ -45,7 +44,7 @@ namespace Jellyfin.Api.Controllers
{
_installationManager = installationManager;
_pluginManager = pluginManager;
- _serializerOptions = JsonDefaults.GetOptions();
+ _serializerOptions = JsonDefaults.Options;
_config = config;
}
@@ -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)
{