mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-23 01:05:19 +03:00
Use distinct for artists to avoid double refreshing
This commit is contained in:
@@ -10,6 +10,10 @@ namespace MediaBrowser.Controller.Library
|
||||
{
|
||||
public static class NameExtensions
|
||||
{
|
||||
public static IEnumerable<string> DistinctNames(this IEnumerable<string> names)
|
||||
=> names.GroupBy(RemoveDiacritics, StringComparer.OrdinalIgnoreCase)
|
||||
.Select(x => x.First());
|
||||
|
||||
private static string RemoveDiacritics(string? name)
|
||||
{
|
||||
if (name == null)
|
||||
@@ -19,9 +23,5 @@ namespace MediaBrowser.Controller.Library
|
||||
|
||||
return name.RemoveDiacritics();
|
||||
}
|
||||
|
||||
public static IEnumerable<string> DistinctNames(this IEnumerable<string> names)
|
||||
=> names.GroupBy(RemoveDiacritics, StringComparer.OrdinalIgnoreCase)
|
||||
.Select(x => x.First());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user