Kometa-Team / Kometa

Python script to update metadata information for items in plex as well as automatically build collections and playlists. The Wiki Documentation is linked below.
https://kometa.wiki
MIT License
2.5k stars 306 forks source link

Collectionless Confusion #47

Closed Tharic99 closed 3 years ago

Tharic99 commented 3 years ago

So I think I'm confused with regards to the Collectionless piece. I'll give an example.

Wonder Woman 1984 currently displays in my library as a stand-alone movie, when I believe it should NOT. The movie is a part of the following collections:

80s Movies - Sort title of "++++_61980s Movies" 2020s Movies - Sort title of "++++_62020s Movies" Trending - Sort title of "++++_2Trending" Popular - Sort title of "++++_3Popular" DC Extended Universe - Sort title of "++++_7DC Extended Universe" Action - Sort title of "++_Action" Adventure - Sort title of "++_Adventure" Fantasy - Sort title of "++_Fantasy" Wonder Woman Collection - Sort title of "Wonder Woman Collection" Collectionless - Sort title of "~_Collectionless"

For my Movies.yml file, I have the following section:

  Collectionless:
    plex_collectionless:
      exclude_prefix:
        - +
        - "zz_"
        - "~"
    sort_title: ~_Collectionless
    collection_order: alpha

Edit - All the collections are set to Hide Items.

Am I doing something wrong?

meisnate12 commented 3 years ago

that looks right did you run it more then once? and are you running the dev branch or the master?

Tharic99 commented 3 years ago

Yep, it's been running every day at 3am. I'm on the master branch still.

meisnate12 commented 3 years ago

can you test with the develop branch?

Tharic99 commented 3 years ago

I'm running on the 1.2.2 version now and still having the problem. Logs are attached

meta.log

Alaksin commented 3 years ago

I am also experiencing this problem. It worked fine when I didn't have the normal collections (Batman, Lord of the rings etc) specified with the script. I just had the script for genre/actor/director collections. I added all my other collections recently and since then a lot of them will show up incorrectly in the library

meisnate12 commented 3 years ago

I'm still trying to figure this out I'm honestly not sure whats going on

Alaksin commented 3 years ago

I did some digging into the different tags for the movies. The Alien collection was my starting point, each movie has quite different tags:

Alien - "Halloween." "Sci-Fi" "Ridley Scott" "Alien" "Collectionless" Aliens - "Action" "Adventure" "Halloween." "Sci-Fi" "Thriller" "James Cameron" "Alien" "Collectionless" Alien3 - "Halloween." "David Fincher" "Alien" "Collectionless" Alien Resurrection - "Jean-Pierre Jeunet" "Alien" Prometheus - "Mystery" "Sci-Fi" "Ridley Scott" "Alien" "Collectionless" Alien Covenant - "Ridley Scott" "Alien"

I could see a pattern here, two tags are fine, but if it has more then two it gets added to Collectionless. I have looked at a lot of the other movies that have been incorrectly tagged as Collectionless and this seems to be the common thing

Tharic99 commented 3 years ago

For me, I have an Aladdin Collection. It has three items in the collection:

Aladdin (SHOWS UP OUTSIDE OF COLLECTION) - “90s Movies”, “Walt Disney Animation Studios”, “Aladdin Collection”, “Robin Williams”, “Oscars”, “Adventure”, “Animation”, “Comedy”, “Family”, “Musical”, “Romance”, “Romantic Comedy”, “Fantasy”, “Collectionless” The Return of Jafar – “90s Movies”, “Aladdin Collection”, “Animation”, “Comedy”, “Family”, “Fantasy”, “Musical”, “Romance” Aladdin and the King of Thieves – “90s Movies”, “Aladdin Collection”, “Robin Williams”, “Animation”, “Comedy”, “Family”, “Fantasy”, “Musical”, “Romance”

Ant-Man Collection Ant-Man (SHOWS UP OUTSIDE OF COLLECTION) – “2010s Movies”, “Marvel Cinematic Universe”, “Ant-Man Collection”, “Action”, “Adventure”, “Comedy”, “Sci-Fi”, “Chris Evans”, “Crime”, “Collectionless” Ant-Man and the Wasp – “2010s Movies”, “Ant-Man Collection”, “Best of 2018”, “Action”, “Adventure”, “Comedy”, “Sci-Fi”, “Family”, “Fantasy”

If nothing else, this is making me look at why some of my collections aren’t lining up right. Why isn’t Ant-Man and the Wasp in “Marvel Cinematic Universe”? Why aren’t the other two Aladdin movies in “Walt Disney Animation Studios”? Why is Ant-Man the Wasp in “Best of 2018” but Ant-Man isn’t? Not that I’m saying anything is wrong with TMM here for these items, but either my template itself or the collection I’m looking at on tmdb, etc.

Alaksin commented 3 years ago

Any update on this? This is one of the best features with the script, so I really hope this could be solved

cpt-kuesel commented 3 years ago

@meisnate12 Here are my meta.log and Movies.yml: meta.log Movies.yml.zip

My Collectionless just adds every movie and ignores the excluded collections. Now every movie is shown in addition to the collections.

meisnate12 commented 3 years ago

ok so your problem is its set up wrong the exclude collections should be ones where movies shouldn't hide. try changing your collectionless config to this

Collectionless:
    plex_collectionless:
      exclude_prefix: 
        - zzz
        - +++
    sort_title: zzz_Collectionless
    collection_order: alpha

I'll try and think of a way to make this more clear but basically you want to exclude every collection that's special like Trending, Popular, Actor, and other specials collections. You have to exclude those collections from being looked at when collectionless is running

cpt-kuesel commented 3 years ago

ohhh i see! i just started using plex-meta-manager, but this was not clear to me.

maybe its just wording and you change it to "include"? because in my new found understanding its like this now: collectionless gathers all movies without collection tag and includes every collection that has prefixes or is mentioned explicitly.

meisnate12 commented 3 years ago

yea basically i choose exclude because it gathers all movies without collection tag and while viewing collection tags it excludes tags that have excluded prefixes or are excluded explicitly.

I dont want to change the keyword exclude because when people update the programs their configs would break.

cpt-kuesel commented 3 years ago

youre right, dont want to break existing configs. turns out i cant read, its right there in the first sentence of the wiki "Gets every movie/show that is not in a collection unless the collection is in the exclusion list.". i spend so much time last weekend on this page, but it wouldnt click :D thank you for helping me understand it just now!

meisnate12 commented 3 years ago

ok i think i might have found what's wrong can someone test with the develop branch and see if it fixes the issue

Tharic99 commented 3 years ago

ok i think i might have found what's wrong can someone test with the develop branch and see if it fixes the issue

Just pulled latest dev down and running with a --run now. My last run at 3am was Run Time: 2:47:21 so I'll let you know after.

I'm also running as:

######################################################
#            Collectionless Collection               #
######################################################

  Collectionless:
    plex_collectionless:
      exclude_prefix:
        - +
        - zz
    sort_title: ~_Collectionless
    collection_order: alpha

So hopefully that's correct!

meisnate12 commented 3 years ago

ok awesome thanks for testing it. you can run it quicker if you run it using the --run option and the --test and then add test: true to the collection config like below

python plex_meta_manager.py --run --test

  Collectionless:
    plex_collectionless:
      exclude_prefix:
        - +
        - zz
    sort_title: ~_Collectionless
    collection_order: alpha
    test: true

This will cause the program to only run collections with test: true so you can more easily test run specific collections

Tharic99 commented 3 years ago

Okay. I'm not seeing anything different, but I'm going to post my log here as well for you.

I have the Aladdin Collection. It has three items in the collection:

Aladdin (SHOWS UP OUTSIDE OF COLLECTION) - “90s Movies”, “Walt Disney Animation Studios”, “Aladdin Collection”, “Robin Williams”, “Oscars”, “Adventure”, “Animation”, “Comedy”, “Family”, “Musical”, “Romance”, “Romantic Comedy”, “Fantasy”, “Collectionless” The Return of Jafar – “90s Movies”, “Aladdin Collection”, “Animation”, “Comedy”, “Family”, “Fantasy”, “Musical”, “Romance” Aladdin and the King of Thieves – “90s Movies”, “Aladdin Collection”, “Robin Williams”, “Animation”, “Comedy”, “Family”, “Fantasy”, “Musical”, “Romance”

meta.log

I don't see it configured in the collectionless settings, but in the log, I see this line:

[2021-03-16 11:13:32,425] [util.py:745]               [INFO]     |====================================================================================================|
[2021-03-16 11:13:32,426] [util.py:749]               [INFO]     |                                     Collectionless Collection                                      |
[2021-03-16 11:13:32,426] [util.py:750]               [INFO]     |====================================================================================================|
[2021-03-16 11:13:32,426] [config.py:425]             [INFO]     |                                                                                                    |
[2021-03-16 11:13:32,427] [builder.py:192]            [INFO]     | Scanning Collectionless Collection                                                                 |
[2021-03-16 11:13:32,427] [builder.py:219]            [DEBUG]    |                                                                                                    |
[2021-03-16 11:13:32,427] [builder.py:220]            [DEBUG]    | Method: plex_collectionless                                                                        |
[2021-03-16 11:13:32,427] [builder.py:221]            [DEBUG]    | Value: ordereddict([('exclude_prefix', ['+', 'zz'])])                                              |
[2021-03-16 11:13:32,428] [builder.py:219]            [DEBUG]    |                                                                                                    |
[2021-03-16 11:13:32,428] [builder.py:220]            [DEBUG]    | Method: sort_title                                                                                 |
[2021-03-16 11:13:32,428] [builder.py:221]            [DEBUG]    | Value: ~_Collectionless                                                                            |
[2021-03-16 11:13:32,428] [builder.py:219]            [DEBUG]    |                                                                                                    |
[2021-03-16 11:13:32,429] [builder.py:220]            [DEBUG]    | Method: collection_order                                                                           |
[2021-03-16 11:13:32,429] [builder.py:221]            [DEBUG]    | Value: alpha                                                                                       |
[2021-03-16 11:13:32,429] [builder.py:219]            [DEBUG]    |                                                                                                    |
[2021-03-16 11:13:32,429] [builder.py:220]            [DEBUG]    | Method: test                                                                                       |
[2021-03-16 11:13:32,430] [builder.py:221]            [DEBUG]    | Value: True                                                                                        |
[2021-03-16 11:13:32,454] [config.py:448]             [INFO]     |                                                                                                    |
[2021-03-16 11:13:32,455] [config.py:455]             [INFO]     | Sync Mode: append    

If it's set to append for a sync mode, wouldn't it only add new items to the sync? It's not REMOVING things from Collectionless like this, right?

Is that the issue?

meisnate12 commented 3 years ago

it could be lol i just updated develop can you try again

Tharic99 commented 3 years ago

I just ran with a sync on collectionless and got this error

| Method: sync_mode                                                                                  |
| Value: sync                                                                                        |
| Collection Error: sync_mode attribute does not work for Collectionless collection    

it could be lol i just updated develop can you try again

Will do now

Tharic99 commented 3 years ago

Nope, Aladdin is still in the Collectionless collection. Log attached

meta.log

meisnate12 commented 3 years ago

so im still working on a fix but i think this is a problem with how plex renames collections. I found one not working for me and its all three Planet of the Apes Movies. The original collection from TMDb is Called Planet of the Apes (Reboot) i renamed this to just Planet of the Apes. If i go to the details and look at the collections those movies have it lists Planet of the Apes (Reboot) instead of Planet of the Apes. my program matches Planet of the Apes (Reboot) to Planet of the Apes and determines that its a collectionless movie since those names dont match.

Is something similar happening to you?

Tharic99 commented 3 years ago

Hmm, not that I've noticed. It's finishing up the collectionless right now and I didn't see that it put Aladdin into the list. What I did was go into Plex and I deleted the entire Collectionless collection, so PMM is re-creating the whole thing right now. But so far, it looks like it's re-creating it without including Aladdin.

Edit - And it timed out on the C's... even with a 120 timer..

Re-running it now.

meisnate12 commented 3 years ago

its doing alot more work in the dev branch. Before it just pinged the all endpoint one time to get all movies and then check them but the info needed isnt there so i have to reload every object (which is a call to the API for every single one) and then check so it's gonna take more time and have a higher chance of timing out

meisnate12 commented 3 years ago

ok while a little slower im confident the latest version in develop will fix collectionless problems

Tharic99 commented 3 years ago

Okay, thanks. I just pulled down latest again. I've failed 3 times now with timeouts and just bumped my timeout up to 180 to see if it can make it through.

Starting now

Tharic99 commented 3 years ago

Okay.. So it looks like Aladdin has gone away now! Whew!

I've got some stuff that looks like it SHOULD be in collectionless, but isn't, but I think that's the exclude right?

1917 is in the following:

IMDB Top 250 (sort = ++++_4Top Rated) Best of 2020 (sort = ++++_5Best of 2020) Oscars (sort = ++++_5Oscars) 2010s Movies (sort = ++++_62010s Movies) Drama (sort = ++_Drama) Thriller (sort = ++_Thriller) War (sort = ++_War)

Then my collectionless section is

######################################################
#            Collectionless Collection               #
######################################################

  Collectionless:
    plex_collectionless:
      exclude_prefix:
        - +
        - zz
    sort_title: ~_Collectionless
    collection_order: alpha
    test: true

So the way you explained it earlier, I need to REMOVE the - + line, right?

meisnate12 commented 3 years ago

No, you have it right you're excluding the collections which you don't want movies to hide in. The script will exclude all collections that start with + or zz when testing to see if a movie is in a collection and if it's in a collection that isn't excluded it won't be added to collectionless

meisnate12 commented 3 years ago

you might be having trouble because your not excluding the collectionless collection add ~ to the exclude_prefix

Alaksin commented 3 years ago

I tested it and it looks good for me

Tharic99 commented 3 years ago

Mine looks good as well from the 3am full run. In fact, it looks REALLY good. This is a huge huge benefit of PMM in my view.