bakes82 167 Posted July 6, 2024 Posted July 6, 2024 Whats the way to get a box set to pass in to the RemoveFromCollection method? The rest api just takes in the internal id which is what Im passing to the GetItemById method var existingCollection = _libraryManager.GetItemById(collection.CollectionId); _collectionManager.RemoveFromCollection(existingCollection as BoxSet, mediaItems.Select(x => x.InternalId) .ToArray()); No collection exists with the supplied Id at Emby.Server.Implementations.Collections.CollectionManager.RemoveFromCollection(BoxSet collection, Int64[] itemIds)
Luke 42077 Posted July 6, 2024 Posted July 6, 2024 Quote collection.CollectionId What is the collection object?
bakes82 167 Posted July 6, 2024 Author Posted July 6, 2024 4 minutes ago, Luke said: What is the collection object? The "collection" object is my custom class, the collectionId is the long - internal id that you need to use to pass in to _collectionManger.AddCollection, and to delete a collection you use the BaseItem from GetItemById its weird this remove from collection takes in a boxsex, so I need the magic to get a boxset item from a internal long id
Solution Luke 42077 Posted July 7, 2024 Solution Posted July 7, 2024 The message of the exception that gets thrown is outdated, and that will be fixed, but what is happening is you passed in null. Logging will probably be needed to capture what is being passed into GetItemById, making sure it's non-zero, as well as what comes out of that.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now