diff options
| author | Patrick Barron <18354464+barronpm@users.noreply.github.com> | 2020-04-22 13:44:20 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-22 13:44:20 +0000 |
| commit | 7586c6022428fd4e1296653a5c281d83b64c7f8e (patch) | |
| tree | 539c9ca4b74a8027d0e636f7a86c587bd74b05a3 /Emby.Server.Implementations/Collections/CollectionManager.cs | |
| parent | f26f44acaf86bb35ff1d2be7cb37a57dee7a47cf (diff) | |
| parent | a85b1dcba663fe3bbb2441380cd8da382c92f2bd (diff) | |
Merge branch 'master' into warnings-cleanup1
Diffstat (limited to 'Emby.Server.Implementations/Collections/CollectionManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/Collections/CollectionManager.cs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/Emby.Server.Implementations/Collections/CollectionManager.cs b/Emby.Server.Implementations/Collections/CollectionManager.cs index 4b04accbb..7c518d483 100644 --- a/Emby.Server.Implementations/Collections/CollectionManager.cs +++ b/Emby.Server.Implementations/Collections/CollectionManager.cs @@ -125,9 +125,9 @@ namespace Emby.Server.Implementations.Collections { var folder = GetCollectionsFolder(false).Result; - return folder == null ? - new List<BoxSet>() : - folder.GetChildren(user, true).OfType<BoxSet>(); + return folder == null + ? Enumerable.Empty<BoxSet>() + : folder.GetChildren(user, true).OfType<BoxSet>(); } /// <inheritdoc /> @@ -210,7 +210,6 @@ namespace Emby.Server.Implementations.Collections private void AddToCollection(Guid collectionId, IEnumerable<string> ids, bool fireEvent, MetadataRefreshOptions refreshOptions) { var collection = _libraryManager.GetItemById(collectionId) as BoxSet; - if (collection == null) { throw new ArgumentException("No collection exists with the supplied Id"); @@ -310,10 +309,13 @@ namespace Emby.Server.Implementations.Collections } collection.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None); - _providerManager.QueueRefresh(collection.Id, new MetadataRefreshOptions(new DirectoryService(_fileSystem)) - { - ForceSave = true - }, RefreshPriority.High); + _providerManager.QueueRefresh( + collection.Id, + new MetadataRefreshOptions(new DirectoryService(_fileSystem)) + { + ForceSave = true + }, + RefreshPriority.High); ItemsRemovedFromCollection?.Invoke(this, new CollectionModifiedEventArgs { |
