mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-06 10:22:04 +01:00
Fix distinction queries (#14007)
This commit is contained in:
@@ -130,7 +130,7 @@ namespace Emby.Server.Implementations.IO
|
||||
private void ProcessPathChanges(List<string> paths)
|
||||
{
|
||||
IEnumerable<BaseItem> itemsToRefresh = paths
|
||||
.Distinct(StringComparer.OrdinalIgnoreCase)
|
||||
.Distinct()
|
||||
.Select(GetAffectedBaseItem)
|
||||
.Where(item => item is not null)
|
||||
.DistinctBy(x => x!.Id)!; // Removed null values in the previous .Where()
|
||||
|
||||
@@ -121,7 +121,7 @@ namespace Emby.Server.Implementations.IO
|
||||
.Where(IsLibraryMonitorEnabled)
|
||||
.OfType<Folder>()
|
||||
.SelectMany(f => f.PhysicalLocations)
|
||||
.Distinct(StringComparer.OrdinalIgnoreCase)
|
||||
.Distinct()
|
||||
.Order();
|
||||
|
||||
foreach (var path in paths)
|
||||
|
||||
@@ -668,10 +668,10 @@ namespace Emby.Server.Implementations.Library
|
||||
|
||||
var list = originalList.Where(i => i.IsDirectory)
|
||||
.Select(i => Path.TrimEndingDirectorySeparator(i.FullName))
|
||||
.Distinct(StringComparer.OrdinalIgnoreCase)
|
||||
.Distinct()
|
||||
.ToList();
|
||||
|
||||
var dupes = list.Where(subPath => !subPath.EndsWith(":\\", StringComparison.OrdinalIgnoreCase) && list.Any(i => _fileSystem.ContainsSubPath(i, subPath)))
|
||||
var dupes = list.Where(subPath => !subPath.EndsWith(":\\", StringComparison.Ordinal) && list.Any(i => _fileSystem.ContainsSubPath(i, subPath)))
|
||||
.ToList();
|
||||
|
||||
foreach (var dupe in dupes)
|
||||
@@ -679,7 +679,7 @@ namespace Emby.Server.Implementations.Library
|
||||
_logger.LogInformation("Found duplicate path: {0}", dupe);
|
||||
}
|
||||
|
||||
var newList = list.Except(dupes, StringComparer.OrdinalIgnoreCase).Select(_fileSystem.GetDirectoryInfo).ToList();
|
||||
var newList = list.Except(dupes, StringComparer.Ordinal).Select(_fileSystem.GetDirectoryInfo).ToList();
|
||||
newList.AddRange(originalList.Where(i => !i.IsDirectory));
|
||||
return newList;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user