mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-23 22:25:09 -04:00
New: Don't require artist mapping
This commit is contained in:
@@ -153,5 +153,15 @@ namespace NzbDrone.Common.Extensions
|
||||
{
|
||||
return string.Join(separator, source.Select(predicate));
|
||||
}
|
||||
|
||||
public static TSource MostCommon<TSource>(this IEnumerable<TSource> items)
|
||||
{
|
||||
return items.GroupBy(x => x).OrderByDescending(x => x.Count()).First().Key;
|
||||
}
|
||||
|
||||
public static TResult MostCommon<TSource, TResult>(this IEnumerable<TSource> items, Func<TSource, TResult> predicate)
|
||||
{
|
||||
return items.Select(predicate).GroupBy(x => x).OrderByDescending(x => x.Count()).First().Key;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user