mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 13:57:14 -04:00
25 lines
642 B
C#
25 lines
642 B
C#
using System;
|
|
using System.Linq;
|
|
using System.Collections.Generic;
|
|
using MediaBrowser.Controller.Extensions;
|
|
|
|
namespace MediaBrowser.Controller.Library
|
|
{
|
|
public static class NameExtensions
|
|
{
|
|
private static string RemoveDiacritics(string name)
|
|
{
|
|
if (name == null)
|
|
{
|
|
return string.Empty;
|
|
}
|
|
|
|
return name.RemoveDiacritics();
|
|
}
|
|
|
|
public static IEnumerable<string> DistinctNames(this IEnumerable<string> names)
|
|
=> names.GroupBy(RemoveDiacritics, StringComparer.OrdinalIgnoreCase)
|
|
.Select(x => x.First());
|
|
}
|
|
}
|