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

Feature Request: Library specific search in a collection #341

Closed Alaksin closed 2 years ago

Alaksin commented 3 years ago

Is your feature request related to a problem? Please describe. Having cross-library collections often requires having different specifications of the collection in each library. One issue is that some options are only valid in a movie or a TV show library. You can't put them both into one definition since the script will crash if the option isn't allowed. This adds a lot of extra lines to the yml files and makes it more difficult to keep things tidy.

Describe the solution you'd like It would be a lot easier to be able to specify a collection in one place. This would require that you can set search criterias for different libraries in the collection or template specification. Here's an example:

templates:

  Director:
    sync_mode: sync
    collection_order: release
    tmdb_person: <<person>>
    sort_title: ΩΩ5 <<collection_name>>
    name_mapping: "- People/<<collection_name>>"
    libraries:
      Movies:
        plex_search:
        any:
          director: tmdb
      Documentary Movies:
        plex_search:
        any:
          director: tmdb
      TV Shows:
       plex_search:
       any:
         title: <<title>>

collections:
  Lars von Trier:
    template:
      name: Director
      person: 42
      title: Riget

  Oliver Stone:
    template:
      name: Director
      person: 1152
      title:
        - Untold History of the United States
        - Putin Interviews
meisnate12 commented 3 years ago

ok i went a slightly different route i added validate_builders as a collection detail by default this is set to true if you set it to false the program wont throw errors when a builder fails and if you want plex_search or smart_filter attributes to not fail you can also add validate: false to the top level under either

Alaksin commented 3 years ago

That can be useful but it doesn't solve my request. To be able to specify different rules for different libraries in the collection itself is what I'm requesting. Sometimes a search option is usable across libraries. Just as an example, say I have a collection for the band Queen. Works great to search on just the title Queen in the Concerts library, but searching for it in the Movies library it can give all sorts of results. I understand I can work around the rules and utilize the validation to get what I want, but it's a matter of simplicity and readability. There will also be a lot of "hard" rules like exact movie titles or IDs. It's much easier to maintain simple and broad rules. I also like to avoid having to use rules that I know don't work or that I don't want to search for in certain libraries.

meisnate12 commented 3 years ago

I get the initial request it's just a lot of extra coding to get things working like your asking. I was hoping validate_builders would help since I could add that a lot easier. The Program was designed with the idea of one Metadata file per library so it won't be quick to do what your asking. You could accomplish what you want by splitting your file a little bit. Just have a different Metadata file per library and have a shared metadata file for the collections that are the same for both libraries. I'll leave the request open I'm just not sure when ill get around to it because my next and highest priority for PMM is building a GUI and I want to put my time into that since once its done we wont need yaml files anyways.

Alaksin commented 3 years ago

I understand it can require some rewriting and I know I can accomplish it with some workarounds. I just really like the idea of specifying a Collection in one place, no matter how libraries it will be in. Anyway, if you are going to make a GUI maybe this is something you can take into consideration for that. Like when you edit a collection you can edit for all the libraries and such. Really looking forward to seeing the GUI, but I guess it will take some time, not the easiest task to make something for all these configurations.

meisnate12 commented 2 years ago

i dont plan on adding this feature so I'm going to close this