diff options
| author | crobibero <cody@robibe.ro> | 2020-06-20 16:03:19 -0600 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-06-20 16:03:19 -0600 |
| commit | d1ca0cb4c7161b420c32e48824cc5065054b1869 (patch) | |
| tree | 5dc0b6c9fc9d1487b8e88d2716376b390ddb7823 /Jellyfin.Api/Helpers/RequestHelpers.cs | |
| parent | 3329b08b40bb7d7e98264969c1b4c9e356fbdec2 (diff) | |
Use proper DtoOptions extensions
Diffstat (limited to 'Jellyfin.Api/Helpers/RequestHelpers.cs')
| -rw-r--r-- | Jellyfin.Api/Helpers/RequestHelpers.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Jellyfin.Api/Helpers/RequestHelpers.cs b/Jellyfin.Api/Helpers/RequestHelpers.cs index 2ff40a8a5..e2a0cf4fa 100644 --- a/Jellyfin.Api/Helpers/RequestHelpers.cs +++ b/Jellyfin.Api/Helpers/RequestHelpers.cs @@ -1,4 +1,5 @@ using System; +using System.Linq; using Jellyfin.Data.Enums; using MediaBrowser.Controller.Net; using MediaBrowser.Controller.Session; @@ -73,5 +74,22 @@ namespace Jellyfin.Api.Helpers return session; } + + /// <summary> + /// Get Guid array from string. + /// </summary> + /// <param name="value">String value.</param> + /// <returns>Guid array.</returns> + internal static Guid[] GetGuids(string? value) + { + if (value == null) + { + return Array.Empty<Guid>(); + } + + return value.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries) + .Select(i => new Guid(i)) + .ToArray(); + } } } |
