You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jellyfin/MediaBrowser.Controller/Library/NameExtensions.cs

27 lines
674 B

#pragma warning disable CS1591
using System;
6 years ago
using System.Collections.Generic;
using System.Linq;
6 years ago
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)
6 years ago
=> names.GroupBy(RemoveDiacritics, StringComparer.OrdinalIgnoreCase)
.Select(x => x.First());
6 years ago
}
}