Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plex_collectionless including items that are in collections #1542

Closed
dstufft opened this issue Jul 28, 2023 · 1 comment
Closed

plex_collectionless including items that are in collections #1542

dstufft opened this issue Jul 28, 2023 · 1 comment
Assignees
Labels
bug Bug is with Plex Meta Manager status:not-yet-viewed I haven't reviewed the Feature or Bug yet

Comments

@dstufft
Copy link

dstufft commented Jul 28, 2023

Version Number

1.19.0

What branch are you on?

master

Describe the Bug

I have my plex_collectionless setup, and in general it is working fine. However I've noticed that some movies get added to my collectionless collection, even though they are inside of collections that should not be excluded. It has appeared (thus far) to be pretty random which movies it affected. I would run into cases where the same Collection would have some movies added to the collectionless collection and some wouldn't.

I've done a bit of debugging, and I think I've got a reasonable handle on why these particular movies are affected but others are not.

What I've done is drop some debugging into this area https://github.com/meisnate12/Plex-Meta-Manager/blob/3bf1c25990a0eee9e1c907e516795fd8a92b0afb/modules/plex.py#L1057-L1066

To see exactly what collections were in the collection_indexes and what collections were in item.collections to figure out what was going on, and what I've seen is that item.collections only returns the first two collections (in order of the collection tags in the item's individual tags), and any other collections are truncated.

So for example, in my case the "Black Panther" collection has the "Black Panther" movie. The collection_indexes contains "black panther", but when I look at item.collections I only see entries for two collections, "Marvel Cinematic Universe", and "All Movies".

Looking at Black Panther's collection tags, I see this:

image

And if I reorder them so Black Panther comes first, then item.collections still contains only two collections, but one of those includes the Black Panther collection, and everything works as expected.

I saw that it appeared that PMM was using the Python plexpai project to query Plex, so I did try doing the same thing with plexapi directly, and they seem to have similar behavior:

from plexapi.server import PlexServer
plex = PlexServer(...)
movie = plex.library.section("Movies").search(title="Black Panther")[0]
print(movie.collections)

Prints out the same two collections, and misses the other 3.

However, if I change that to instead say:

from plexapi.server import PlexServer
plex = PlexServer(...)
movie = plex.library.section("Movies").search(title="Black Panther")[0]
movie.reload()
print(movie.collections)

Then I get all 5 collections as expected, however it appears that while PMM is using plexapi, it's manually constructing the queries, so I'm not sure how to convert that to what PMM is doing.

Relevant Collection/Overlay/Playlist Definition

No response

Logs

No response

@dstufft dstufft added bug Bug is with Plex Meta Manager status:not-yet-viewed I haven't reviewed the Feature or Bug yet labels Jul 28, 2023
@meisnate12
Copy link
Member

so this should already be address in nightly im reloading the item just before i pull its collections can you confirm if youre still having the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug is with Plex Meta Manager status:not-yet-viewed I haven't reviewed the Feature or Bug yet
Projects
None yet
Development

No branches or pull requests

2 participants