mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-18 23:13:06 +03:00
Add GPL modules
This commit is contained in:
25
MediaBrowser.Controller/Sorting/SortHelper.cs
Normal file
25
MediaBrowser.Controller/Sorting/SortHelper.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
namespace MediaBrowser.Controller.Sorting
|
||||
{
|
||||
public static class SortHelper
|
||||
{
|
||||
private enum ChunkType { Alphanumeric, Numeric };
|
||||
|
||||
public static bool InChunk(char ch, char otherCh)
|
||||
{
|
||||
var type = ChunkType.Alphanumeric;
|
||||
|
||||
if (char.IsDigit(otherCh))
|
||||
{
|
||||
type = ChunkType.Numeric;
|
||||
}
|
||||
|
||||
if ((type == ChunkType.Alphanumeric && char.IsDigit(ch))
|
||||
|| (type == ChunkType.Numeric && !char.IsDigit(ch)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user