#My all's and any's are messed up

1 messages · Page 1 of 1 (latest)

frosty reef
#

I'm trying to create a collection that's 1) a genre of Family, Animation, or Children AND 2) a label of Rated_NR, Rated_G, or Rated_PG. I keep getting : Collection Error: all must be a dictionary: [{'any': [{'genre': ['Family', 'Animation', 'Children']}, {'label': ['Rated_G', 'Rated_PG', 'Rated_NR']}]}]

collections:
  
  Kids:
    template: { name: Category, schedule: hourly(21) }
    summary: Kid friendly movies
    smart_label: title.asc
    plex_search:
      validate: false
      all:
        - any:
            - genre: 
              - Family
              - Animation
              - Children
            - label:
              - Rated_G
              - Rated_PG
              - Rated_NR   
hoary ermineBOT
#

Welcome @frosty reef!

Thanks for being a PMM Sponsor, we greatly appreciate it! Your ticket will now be diverted to <@&1097919568334311495> and <@&938443185347244033>.

Including the meta.log from the beginning is a huge help, type !logs for more information.

#

You can press the "Close Post" button above or type /close at any time to close this post.

frosty reef
#

ChatGPT was no help

lyric charm
#

That indentation is all kinds of wrong, and - any: isn't valid

frosty reef
#

yep, something's wrong

lyric charm
#

It appears that you aren't leveraging any of the examples on the plex search page, since none of them show something like - genre: or - label:

frosty reef
#

This is one of many variations where I've tried to get this to work. The other variations didnt look like this.

lyric charm
#

I'd start with this example:

collections:
  Dave Chappelle Comedy:
    plex_search:
      all:
        actor: Dave Chappelle
        genre: Comedy
#

Change the name:

collections:
  Kids:
    plex_search:
      all:
        actor: Dave Chappelle
        genre: Comedy
#

then the fields:

collections:
  Kids:
    plex_search:
      all:
        label: something here
        genre: something here
frosty reef
#

I tried that but it resulted in all items matching

lyric charm
#

Those are supposed to be lists, so maybe:

collections:
  Kids:
    plex_search:
      all:
        label:
          - Rated_G
          - Rated_PG
          - Rated_NR   
        genre:
          - Family
          - Animation
          - Children
frosty reef
#

thats the exact code I have now and there are no results

#

I think the all if requiring everything listed to be there

#

For example, if I comment out the genre stuff I get media that each has to have genres of family, aniimation, and children

#

as oposed to just one of those genres

lyric charm
#

That shoudl be, by my reading,

label needs to be one of these three
genre needs to be one of these three
both [all] of those need to be true

frosty reef
#

which is why I tried the any

#

maybe what I am asking is not possible in PMM

#

I want media with one of the genres but also one of the ratings

#

which is why I tried to combine the all and any

lyric charm
#

My expectation is that the above should provide that.

#

If you create this filter in Plex, does it return results?

frosty reef
#

The above PMM yaml doesnt provide the expected result as it is ANDING everything

#
| Filter:                                                                                            |
|   Match all of the following:                                                                      |
|     Genre is Family                                                                                |
|     Genre is Animation                                                                             |
|     Genre is Children                                                                              |
|     Label is Rated_G                                                                               |
|     Label is Rated_PG                                                                              |
|     Label is Rated_NR
#

Plex filters work fine with this example because there are rule groups

lyric charm
#

As I recall there's a way to give the search URL that plex builds to PMM.

#

let me see if I can find it

frosty reef
#

Without that, the only way I can think of to do this is ti create a label for each one of those groups (ex. kid genres, kid ratings) and then AND on those two labels

lyric charm
#

Here it is:
<#masters-chat message>

frosty reef
#

Got it to work with this:

  Kids:
    template: { name: Category, schedule: hourly(21) }
    summary: Kid-friendly movies
    smart_label: title.asc
    plex_search:
      validate: false
      label: Rated_G, Rated_PG, Rated_NR
      any:
        genre: Children, Family, Animation  
frosty reef
#

Final result: This produced the equivalent of the plex filter:

  Kids:
    template: { name: Category, schedule: hourly(21) }
    summary: Kid-friendly movies
    smart_label: title.asc
    plex_search:
      validate: false
      label: Rated_G, Rated_PG, Rated_NR
      genre: Children, Family, Animation  

Log Ouput:

| Filter:                                                                                            |
|   Match all of the following:                                                                      |
|     Match any of the following:                                                                    |
|       Label is Rated_G                                                                             |
|       Label is Rated_PG                                                                            |
|       Label is Rated_NR                                                                            |
|     Match any of the following:                                                                    |
|       Genre is Children                                                                            |
|       Genre is Family                                                                              |
|       Genre is Animation                                                                           |
|
lyric charm
frosty reef
#

thanks - I'll keep the smart url thing in mind for the future. for now, the above query works for me. Thanks again