jellyfin/MediaBrowser.Controller/Library/NameExtensions.cs

27 lines
673 B
C#
Raw Normal View History

2016-10-25 12:02:04 -07:00
using System;
2015-04-09 14:11:57 -07:00
using System.Collections.Generic;
using MediaBrowser.Controller.Extensions;
2016-10-21 19:08:34 -07:00
using MediaBrowser.Model.Extensions;
2015-04-09 14:11:57 -07:00
namespace MediaBrowser.Controller.Library
{
public static class NameExtensions
{
2015-04-15 08:41:42 -07:00
private static string RemoveDiacritics(string name)
{
if (name == null)
2015-04-09 14:11:57 -07:00
{
return string.Empty;
}
2015-04-15 08:41:42 -07:00
//return name;
2015-04-09 14:11:57 -07:00
return name.RemoveDiacritics();
}
public static IEnumerable<string> DistinctNames(this IEnumerable<string> names)
{
2015-04-15 08:41:42 -07:00
return names.DistinctBy(RemoveDiacritics, StringComparer.OrdinalIgnoreCase);
}
}
2015-04-09 14:11:57 -07:00
}