// // Copyright (c) PlaceholderCompany. All rights reserved. // namespace MediaBrowser.Model.Extensions; using global::System; using global::System.Linq; using MediaBrowser.Model.Configuration; /// /// Extensions for . /// public static class LibraryOptionsExtension { /// /// Get the custom tag delimiters. /// /// This LibraryOptions. /// CustomTagDelimiters in char[]. public static char[] GetCustomTagDelimiters(this LibraryOptions options) { ArgumentNullException.ThrowIfNull(options); var delimiterList = options.CustomTagDelimiters.Select(x => { var isChar = char.TryParse(x, out var c); if (isChar) { return c; } return null; }).Where(x => x is not null).Select(x => x!.Value).ToList(); delimiterList.Add('\0'); return delimiterList.ToArray(); } }