using System; using System.Linq; using MediaBrowser.Model.Configuration; namespace MediaBrowser.Model.Extensions; /// /// 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(); } }