jellyfin/MediaBrowser.Controller/Library/NameExtensions.cs

27 lines
673 B
C#
Raw Normal View History

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