mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-20 17:14:42 +01:00
Remove MoreLINQ
This commit is contained in:
@@ -335,7 +335,11 @@ namespace MediaBrowser.Controller.Entities
|
||||
.OfType<Folder>()
|
||||
.ToList();
|
||||
|
||||
return PhysicalLocations.Where(i => !FileSystem.AreEqual(i, Path)).SelectMany(i => GetPhysicalParents(i, rootChildren)).DistinctBy(i => i.Id);
|
||||
return PhysicalLocations
|
||||
.Where(i => !FileSystem.AreEqual(i, Path))
|
||||
.SelectMany(i => GetPhysicalParents(i, rootChildren))
|
||||
.GroupBy(x => x.Id)
|
||||
.Select(x => x.First());
|
||||
}
|
||||
|
||||
private IEnumerable<Folder> GetPhysicalParents(string path, List<Folder> rootChildren)
|
||||
|
||||
@@ -270,7 +270,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
// This depends on settings for that series
|
||||
// When this happens, remove the duplicate from season 0
|
||||
|
||||
return allEpisodes.DistinctBy(i => i.Id).Reverse();
|
||||
return allEpisodes.GroupBy(i => i.Id).Select(x => x.First()).Reverse();
|
||||
}
|
||||
|
||||
public async Task RefreshAllMetadata(MetadataRefreshOptions refreshOptions, IProgress<double> progress, CancellationToken cancellationToken)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Controller.Extensions;
|
||||
using MediaBrowser.Model.Extensions;
|
||||
|
||||
namespace MediaBrowser.Controller.Library
|
||||
{
|
||||
@@ -14,13 +14,11 @@ namespace MediaBrowser.Controller.Library
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
//return name;
|
||||
return name.RemoveDiacritics();
|
||||
}
|
||||
|
||||
public static IEnumerable<string> DistinctNames(this IEnumerable<string> names)
|
||||
{
|
||||
return names.DistinctBy(RemoveDiacritics, StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
=> names.GroupBy(RemoveDiacritics, StringComparer.OrdinalIgnoreCase)
|
||||
.Select(x => x.First());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user