aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Collections/CollectionManager.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2020-04-22 13:16:08 +0200
committerGitHub <noreply@github.com>2020-04-22 13:16:08 +0200
commit07326c1d9b1a74b6802cd4187104c4272d59e28e (patch)
tree1061f46729d67671eeb9b6bd71320732e83ccef9 /Emby.Server.Implementations/Collections/CollectionManager.cs
parentdaed41815f23795aad7f54965a8ef7eae44a1e08 (diff)
parenta85b1dcba663fe3bbb2441380cd8da382c92f2bd (diff)
Merge branch 'master' into fix-auth-response-codes
Diffstat (limited to 'Emby.Server.Implementations/Collections/CollectionManager.cs')
-rw-r--r--Emby.Server.Implementations/Collections/CollectionManager.cs20
1 files changed, 12 insertions, 8 deletions
diff --git a/Emby.Server.Implementations/Collections/CollectionManager.cs b/Emby.Server.Implementations/Collections/CollectionManager.cs
index 321952874..68bcc5a4f 100644
--- a/Emby.Server.Implementations/Collections/CollectionManager.cs
+++ b/Emby.Server.Implementations/Collections/CollectionManager.cs
@@ -52,7 +52,9 @@ namespace Emby.Server.Implementations.Collections
}
public event EventHandler<CollectionCreatedEventArgs> CollectionCreated;
+
public event EventHandler<CollectionModifiedEventArgs> ItemsAddedToCollection;
+
public event EventHandler<CollectionModifiedEventArgs> ItemsRemovedFromCollection;
private IEnumerable<Folder> FindFolders(string path)
@@ -109,9 +111,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>();
}
public BoxSet CreateCollection(CollectionCreationOptions options)
@@ -191,7 +193,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");
@@ -289,10 +290,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
{