mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-16 05:53:03 +03:00
Code Clean up: Convert to null-coalescing operator ?? (#5845)
Co-authored-by: Cody Robibero <cody@robibe.ro> Co-authored-by: Patrick Barron <18354464+barronpm@users.noreply.github.com>
This commit is contained in:
@@ -207,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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user