forked from jellyfin/jellyfin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
3 changed files
with
39 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System; | ||
using System.Linq; | ||
using MediaBrowser.Model.Configuration; | ||
|
||
namespace MediaBrowser.Model.Extensions; | ||
|
||
/// <summary> | ||
/// Extensions for <see cref="LibraryOptions"/>. | ||
/// </summary> | ||
public static class LibraryOptionsExtension | ||
{ | ||
/// <summary> | ||
/// Get the custom tag delimiters. | ||
/// </summary> | ||
/// <param name="options">This LibraryOptions.</param> | ||
/// <returns>CustomTagDelimiters in char[].</returns> | ||
public static char[] GetCustomTagDelimiters(this LibraryOptions options) | ||
{ | ||
ArgumentNullException.ThrowIfNull(options); | ||
|
||
return options.CustomTagDelimiters.Select<string, char?>(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).ToArray(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters