-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Deleting collections does not work for me.
To Reproduce
- Get a list of collections
- foreach one, loop through the items and remove them from the collection
- finally delete the collection
Expected behavior
I expected the collections to be deleted. However, after it runs without exceptions, the collections are there, still intact.
Side Note: There is a TODO throw in ApiService line 145 which I had to comment out to get this to function at all.
Here's my code:
var server = factory.CreateServer();
string url = server.Uri.ToString();
try
{
var libs = await server.Libraries();
var movies = libs.Single(c => c.Title == "Movies");
var collections = await factory.PlexLibraryClient.GetCollectionsAsync(server.AccessToken, url, movies.Key, string.Empty);
foreach (var col in collections.Collections)
{
var items = await factory.PlexLibraryClient.GetCollectionItemsAsync(server.AccessToken, url, col.RatingKey);
foreach (var item in items.Media)
{
await factory.PlexLibraryClient.DeleteCollectionFromLibraryItemAsync(server.AccessToken, url, movies.Key, item.RatingKey, col.Title);
}
await factory.PlexLibraryClient.DeleteCollectionFromLibraryItemAsync(server.AccessToken, url, movies.Key, col.RatingKey, col.Title);
}
}
catch (Exception ex)
{
string msg = ex.Message;
}
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working