diff options
| author | crobibero <cody@robibe.ro> | 2020-06-08 13:14:41 -0600 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-06-08 13:14:41 -0600 |
| commit | d97e306cdae11eb2675161aa2a6d828c739b2b01 (patch) | |
| tree | 48a9f36e4a569270a3ad454496058b183754392d /Jellyfin.Api/Helpers/RequestHelpers.cs | |
| parent | e153214e762173ee1f1796a579f28c63065e61f2 (diff) | |
Move PlaylistService to Jellyfin.Api
Diffstat (limited to 'Jellyfin.Api/Helpers/RequestHelpers.cs')
| -rw-r--r-- | Jellyfin.Api/Helpers/RequestHelpers.cs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Jellyfin.Api/Helpers/RequestHelpers.cs b/Jellyfin.Api/Helpers/RequestHelpers.cs new file mode 100644 index 000000000..b1c6a24d0 --- /dev/null +++ b/Jellyfin.Api/Helpers/RequestHelpers.cs @@ -0,0 +1,30 @@ +#nullable enable + +using System; +using System.Linq; + +namespace Jellyfin.Api.Helpers +{ + /// <summary> + /// Request Helpers. + /// </summary> + public static class RequestHelpers + { + /// <summary> + /// Get Guid array from string. + /// </summary> + /// <param name="value">String value.</param> + /// <returns>Guid array.</returns> + public static Guid[] GetGuids(string? value) + { + if (value == null) + { + return Array.Empty<Guid>(); + } + + return value.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries) + .Select(i => new Guid(i)) + .ToArray(); + } + } +} |
