mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-12-27 09:56:33 +00:00
Move GetCustomTagDelimiters to Extension
This commit is contained in:
parent
00ca4abbe1
commit
0ffddacf11
|
@ -149,19 +149,5 @@ namespace MediaBrowser.Model.Configuration
|
|||
|
||||
return null;
|
||||
}
|
||||
|
||||
public char[] GetCustomTagDelimiters()
|
||||
{
|
||||
return 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
32
MediaBrowser.Model/Extensions/LibraryOptionsExtension.cs
Normal file
32
MediaBrowser.Model/Extensions/LibraryOptionsExtension.cs
Normal file
|
@ -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();
|
||||
}
|
||||
}
|
|
@ -16,6 +16,7 @@ using MediaBrowser.Controller.Providers;
|
|||
using MediaBrowser.Model.Dlna;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Extensions;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
|
|
Loading…
Reference in a new issue