mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 05:47:14 -04:00
Fix issues mentioned in review, except for option name
Signed-off-by: Petrus.Z <silencly07@gmail.com>
This commit is contained in:
parent
989013c974
commit
6d74c83ddb
@ -54,9 +54,10 @@ namespace Emby.Server.Implementations.Library.Validators
|
|||||||
Recursive = true
|
Recursive = true
|
||||||
});
|
});
|
||||||
|
|
||||||
var collectionNameMoviesMap = new Dictionary<string, List<Guid>>();
|
var collectionNameMoviesMap = new Dictionary<string, HashSet<Guid>>();
|
||||||
|
|
||||||
foreach (var library in _libraryManager.RootFolder.Children.ToList()) {
|
foreach (var library in _libraryManager.RootFolder.Children)
|
||||||
|
{
|
||||||
if (!_libraryManager.GetLibraryOptions(library).AutoCollection) {
|
if (!_libraryManager.GetLibraryOptions(library).AutoCollection) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -67,7 +68,6 @@ namespace Emby.Server.Implementations.Library.Validators
|
|||||||
IncludeItemTypes = new[] { nameof(Movie) },
|
IncludeItemTypes = new[] { nameof(Movie) },
|
||||||
IsVirtualItem = false,
|
IsVirtualItem = false,
|
||||||
OrderBy = new[] { (ItemSortBy.SortName, SortOrder.Ascending) },
|
OrderBy = new[] { (ItemSortBy.SortName, SortOrder.Ascending) },
|
||||||
SourceTypes = new[] { SourceType.Library },
|
|
||||||
Parent = library,
|
Parent = library,
|
||||||
Recursive = true
|
Recursive = true
|
||||||
});
|
});
|
||||||
@ -78,14 +78,14 @@ namespace Emby.Server.Implementations.Library.Validators
|
|||||||
{
|
{
|
||||||
if (collectionNameMoviesMap.TryGetValue(movie.CollectionName, out var movieList))
|
if (collectionNameMoviesMap.TryGetValue(movie.CollectionName, out var movieList))
|
||||||
{
|
{
|
||||||
if (!movieList.Any(m => m == movie.Id))
|
if (!movieList.Contains(movie.Id))
|
||||||
{
|
{
|
||||||
movieList.Add(movie.Id);
|
movieList.Add(movie.Id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
collectionNameMoviesMap[movie.CollectionName] = new List<Guid> { movie.Id };
|
collectionNameMoviesMap[movie.CollectionName] = new HashSet<Guid> { movie.Id };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user