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.52k stars 307 forks source link

Bug: dictionary_variables not working #558

Closed benfishbus closed 2 years ago

benfishbus commented 2 years ago

Describe the Bug TMDb Collections are not updated with posters specified in the dictionary_variables of a custom template.

Relevant Collection Config

libraries:                                      # Library mappings must have a colon (:) placed after them
  Movies Main:
    metadata_path:
      - file: config/labelMovies.yml
      - file: config/Movies.yml
      - file: config/complexDocumentary.yml
    operations:
      tmdb_collections:
        dictionary_variables:
          poster:
            my_collection_poster:
              920666: https://theposterdb.com/api/assets/30438
              687929: https://www.themoviedb.org/t/p/original/pxaOzqzfZfDQRGIif7OfZkhayye.jpg
              33938: https://theposterdb.com/api/assets/25081
        template:
          optional:
            - poster
          tmdb_collection_details: <<collection_id>>
          collection_order: release
          url_poster: <<my_collection_poster>>

Plex Meta Manager Info Version: 1.14.1

Link to logs (required) https://gist.github.com/benfishbus/153873872bf832d275342d6ab0002739

meisnate12 commented 2 years ago

this ones my bad i messed up when writing the wiki that's not how it should look

library:
  Movies:
    operations:
      tmdb_collections:
        exclude_ids:
          - 10
        remove_suffix: Collection
        dictionary_variables:
          my_collection_poster:
            119: https://www.themoviedb.org/t/p/original/oENY593nKRVL2PnxXsMtlh8izb4.jpg
            531241: https://www.themoviedb.org/t/p/original/nogV4th2P5QWYvQIMiWHj4CFLU9.jpg
        template:
          optional:
            - my_collection_poster
          tmdb_collection_details: <<collection_id>>
          collection_order: release
          url_poster: <<my_collection_poster>>
benfishbus commented 2 years ago

That makes more sense. When I tried it, I got the following error:

|==============================================================================|
|                        Starting Automated Collections                        |
|==============================================================================|
|                                                                              |
| too many values to unpack (expected 2)                                       |
|==============================================================================|
meisnate12 commented 2 years ago

in your meta.log right before this error there should be a bigger traceback can you post that

benfishbus commented 2 years ago
[2022-01-05 09:19:34,924] [util.py:159]               [DEBUG]    | Traceback (most recent call last):                                                                                                                                                                     |
                                                                 |   File "//plex_meta_manager.py", line 289, in update_libraries
                                                                 |     library_operations(config, library)
                                                                 |   File "//plex_meta_manager.py", line 630, in library_operations
                                                                 |     for k, v in library.tmdb_collections["dictionary_variables"]:
                                                                 | ValueError: too many values to unpack (expected 2)