diff options
| author | Petrus.Z <silencly07@gmail.com> | 2021-11-18 16:00:14 +0800 |
|---|---|---|
| committer | Petrus.Z <silencly07@gmail.com> | 2021-11-18 16:00:14 +0800 |
| commit | acb86066fffa14e95d6d5ed52a50409bc1b326a5 (patch) | |
| tree | 112970b6f7322f2d09e3c0285f2df1d75db557eb | |
| parent | 263bbf897ac9699b9bd27e9c7aba812111d08d42 (diff) | |
Replace library option to AutomaticallyAddToCollection
Signed-off-by: Petrus.Z <silencly07@gmail.com>
| -rw-r--r-- | Emby.Server.Implementations/Library/Validators/CollectionPostScanTask.cs | 22 | ||||
| -rw-r--r-- | MediaBrowser.Model/Configuration/LibraryOptions.cs | 4 |
2 files changed, 16 insertions, 10 deletions
diff --git a/Emby.Server.Implementations/Library/Validators/CollectionPostScanTask.cs b/Emby.Server.Implementations/Library/Validators/CollectionPostScanTask.cs index 1ca76ad95..945b559ad 100644 --- a/Emby.Server.Implementations/Library/Validators/CollectionPostScanTask.cs +++ b/Emby.Server.Implementations/Library/Validators/CollectionPostScanTask.cs @@ -47,18 +47,11 @@ namespace Emby.Server.Implementations.Library.Validators /// <returns>Task.</returns> public async Task Run(IProgress<double> progress, CancellationToken cancellationToken) { - var boxSets = _libraryManager.GetItemList(new InternalItemsQuery - { - IncludeItemTypes = new[] { nameof(BoxSet) }, - CollapseBoxSetItems = false, - Recursive = true - }); - var collectionNameMoviesMap = new Dictionary<string, HashSet<Guid>>(); foreach (var library in _libraryManager.RootFolder.Children) { - if (!_libraryManager.GetLibraryOptions(library).AutoCollection) + if (!_libraryManager.GetLibraryOptions(library).AutomaticallyAddToCollection) { continue; } @@ -107,6 +100,19 @@ namespace Emby.Server.Implementations.Library.Validators var numComplete = 0; var count = collectionNameMoviesMap.Count; + if (count == 0) + { + progress.Report(100); + return; + } + + var boxSets = _libraryManager.GetItemList(new InternalItemsQuery + { + IncludeItemTypes = new[] { nameof(BoxSet) }, + CollapseBoxSetItems = false, + Recursive = true + }); + foreach (var (collectionName, movieIds) in collectionNameMoviesMap) { try diff --git a/MediaBrowser.Model/Configuration/LibraryOptions.cs b/MediaBrowser.Model/Configuration/LibraryOptions.cs index 0a676de9a..90cf8f43b 100644 --- a/MediaBrowser.Model/Configuration/LibraryOptions.cs +++ b/MediaBrowser.Model/Configuration/LibraryOptions.cs @@ -16,7 +16,7 @@ namespace MediaBrowser.Model.Configuration SkipSubtitlesIfAudioTrackMatches = true; RequirePerfectSubtitleMatch = true; - AutoCollection = true; + AutomaticallyAddToCollection = true; EnablePhotos = true; SaveSubtitlesWithMedia = true; EnableRealtimeMonitor = true; @@ -81,7 +81,7 @@ namespace MediaBrowser.Model.Configuration public bool RequirePerfectSubtitleMatch { get; set; } public bool SaveSubtitlesWithMedia { get; set; } - public bool AutoCollection { get; set; } + public bool AutomaticallyAddToCollection { get; set; } public TypeOptions[] TypeOptions { get; set; } |
