mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-06-03 13:44:22 -04:00
31 lines
717 B
C#
31 lines
717 B
C#
#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();
|
|
}
|
|
}
|
|
}
|