From d10090b394371e6b588a08b453a1dfb177e90ca1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20E=C3=9Flinger?= Date: Thu, 1 Oct 2020 22:48:42 +0200 Subject: [PATCH 1/2] fix: remove unused null check Co-authored-by: Cody Robibero --- Jellyfin.Api/Controllers/SessionController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jellyfin.Api/Controllers/SessionController.cs b/Jellyfin.Api/Controllers/SessionController.cs index 68cec14151..0ae49ea982 100644 --- a/Jellyfin.Api/Controllers/SessionController.cs +++ b/Jellyfin.Api/Controllers/SessionController.cs @@ -392,7 +392,7 @@ namespace Jellyfin.Api.Controllers _sessionManager.ReportCapabilities(id, new ClientCapabilities { PlayableMediaTypes = RequestHelpers.Split(playableMediaTypes, ',', true), - SupportedCommands = supportedCommands == null ? Array.Empty() : supportedCommands, + SupportedCommands = supportedCommands, SupportsMediaControl = supportsMediaControl, SupportsSync = supportsSync, SupportsPersistentIdentifier = supportsPersistentIdentifier From 21b39a207dd4a6864e9d7bfe1c1e9253cbfc0f06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20E=C3=9Flinger?= Date: Fri, 2 Oct 2020 01:33:15 +0200 Subject: [PATCH 2/2] refactor: simplify null check Co-authored-by: Cody Robibero --- Jellyfin.Api/ModelBinders/CommaDelimitedArrayModelBinder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jellyfin.Api/ModelBinders/CommaDelimitedArrayModelBinder.cs b/Jellyfin.Api/ModelBinders/CommaDelimitedArrayModelBinder.cs index 92bbd96633..208566dc8e 100644 --- a/Jellyfin.Api/ModelBinders/CommaDelimitedArrayModelBinder.cs +++ b/Jellyfin.Api/ModelBinders/CommaDelimitedArrayModelBinder.cs @@ -39,7 +39,7 @@ namespace Jellyfin.Api.ModelBinders { var values = Array.ConvertAll( value.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries), - x => { return converter.ConvertFromString(x != null ? x.Trim() : x); }); + x => converter.ConvertFromString(x?.Trim())); var typedValues = Array.CreateInstance(elementType, values.Length); values.CopyTo(typedValues, 0);