mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-06-03 13:44:22 -04:00
add missing function after merge
This commit is contained in:
parent
14faebc7fe
commit
13c4cb628f
@ -144,5 +144,31 @@ namespace Jellyfin.Api.Helpers
|
|||||||
: Split(filters, ',', true)
|
: Split(filters, ',', true)
|
||||||
.Select(v => Enum.Parse<ItemFilter>(v, true)).ToArray();
|
.Select(v => Enum.Parse<ItemFilter>(v, true)).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the item fields.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="fields">The fields string.</param>
|
||||||
|
/// <returns>IEnumerable{ItemFields}.</returns>
|
||||||
|
internal static ItemFields[] GetItemFields(string? fields)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(fields))
|
||||||
|
{
|
||||||
|
return Array.Empty<ItemFields>();
|
||||||
|
}
|
||||||
|
|
||||||
|
return Split(fields, ',', true)
|
||||||
|
.Select(v =>
|
||||||
|
{
|
||||||
|
if (Enum.TryParse(v, true, out ItemFields value))
|
||||||
|
{
|
||||||
|
return (ItemFields?)value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}).Where(i => i.HasValue)
|
||||||
|
.Select(i => i!.Value)
|
||||||
|
.ToArray();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user