#dynamic collections smart filter

1 messages · Page 1 of 1 (latest)

smoky swallow
#

I am trying to create a unique smart filter for individual collections as part of dynamic collections. specifically I am doing this for seasonal collections. I want, for Christmas only, for the collection to include movies where christmas is in the title. And for example, maybe veterans day will include all 'war' genre movies. Here is what I tried, and it didn't work. The holiday template and all other lines I am using from the default seasonal.yml file.

dynamic_collections:
Seasonal:
type: custom
data:
# ... other seasonal data ...
title_format: <<key_name>> <<library_typeU>>s
template:
- holiday
- shared
- arr
template_variables:
emoji:
# ... other emojis ...
smart_label:
default:
sort_by: title.asc
limit: <<limit_<<key>>>>
all:
label: <<emoji_<<key>>><<key_name>> Movies
christmas:
sort_by: title.asc
limit: <<limit_<<key>>>>
all:
label: <<emoji_<<key>>><<key_name>> Movies
title.contains: "Christmas"
halloween:
sort_by: title.asc
limit: <<limit_<<key>>>>
all:
label: <<emoji_<<key>>><<key_name>> Movies
genre: "Horror"

<<smart_label>> not found in the smart_label attribute data |

smoky talonBOT
#

Welcome @smoky swallow!

Someone from <@&938443185347244033> will assist when they're available.

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.

mighty auroraBOT
#

Please use code blocks when sending any code-related text (such as error messages or configuration file extracts.)

The Grave Accent key (`) is used to define code blocks and is typically found to the left of the number 1 key on a standard keyboard.

If you are posting any yaml-formatted text (such as collections), you can add yaml to your Grave Accent keys for coloured formatting. See the below sample text and output

YOU TYPE THIS

`​`​`yaml
collections:
  Documentaries:
    smart_filter:
      all:
        genre: Documentary
`​`​`

DISCORD DISPLAYS

collections:
  Documentaries:
    smart_filter:
      all:
        genre: Documentary
gray hill
#

It's hard to see what's going on there. Can you format that as code so Discord doesn't mess withe the syntax and indentation?

smoky swallow
#

`dynamic_collections:
Seasonal:
type: custom
data:
# ... other seasonal data ...
title_format: <<key_name>> <<library_typeU>>s
template:

holiday
shared
arr
template_variables:
emoji:# ... other emojis ...
smart_label:
default:
sortby: title.asc
limit: <<limit<<key>>>>
all:
label: <<emoji_<<key>>><<key_name>> Movies
christmas:
sortby: title.asc
limit: <<limit<<key>>>>
all:
label: <<emoji_<<key>>><<key_name>> Movies
title.contains: "Christmas"
halloween:
sortby: title.asc
limit: <<limit<<key>>>>
all:
label: <<emoji_<<key>>><<key_name>> Movies
genre: "Horror"`

#
  Seasonal:
    type: custom
    data:
      # ... other seasonal data ...
    title_format: <<key_name>> <<library_typeU>>s
    template:
      
holiday
shared
arr
template_variables:
  emoji:# ... other emojis ...
  smart_label:
    default:
      sortby: title.asc
      limit: <<limit<<key>>>>
      all:
        label: <<emoji_<<key>>><<key_name>> Movies
    christmas:
      sortby: title.asc
      limit: <<limit<<key>>>>
      all:
        label: <<emoji_<<key>>><<key_name>> Movies
        title.contains: "Christmas"
    halloween:
      sortby: title.asc
      limit: <<limit<<key>>>>
      all:
        label: <<emoji_<<key>>><<key_name>> Movies
        genre: "Horror"```
gray hill
#

One thing, though. dynamic_collections are their own things and you probably can't just copy-paste from the default metadata files to that context.

smoky swallow
#

it works until I add the smart_label portion at the bottom

#

then I get the error <<smart_label>> not found in the smart_label attribute data . I was hoping I could have a custom filtering per holiday

gray hill
#

That smart_label section is unlike any I've ever seen. Where are you finding that syntax?

#

That error is correct. smart_label shoudl look like this:

collections:
  Unplayed Marvel Cinematic Universe:
    trakt_list: whatever
    smart_label:
      sort_by: release.desc
      all:
        label: <<smart_label>>  # You're missing this
        unplayed: true
#

You'd probably be best off just implementing this from scratch rather than copy-pasting stuff from other files.

smoky swallow
#

oh. i'll try that. I tried to copy from the holiday template in the default seasonal.yml. but maybe I did it wrong

templates:
  holiday:
    default:
      sync_mode: sync
      sync_mode_<<key>>: <<sync_mode>>
      sort_by: title.asc
      sort_by_<<key>>: <<sort_by>>
      schedule_<<key>>: <<schedule>>
      limit_<<key>>: <<limit>>
      tmdb_collection_<<key>>: <<tmdb_collection>>
      tmdb_movie_<<key>>: <<tmdb_movie>>
      imdb_list_<<key>>: <<imdb_list>>
      trakt_list_<<key>>: <<trakt_list>>
      mdblist_list_<<key>>: <<mdblist_list>>
      summary_<<key>>: <<summary_format>>
      name_<<key>>: <<name_format>>
      emoji: ""
      emoji_<<key>>: <<emoji>>
    optional:
      - schedule
      - tmdb_collection
      - tmdb_movie
      - limit
      - imdb_list
      - trakt_list
      - mdblist_list
      - summary_format
      - name_format
      - key_name
      - translation_key
      - limit
    smart_label:
      sort_by: <<sort_by_<<key>>>>
      limit: <<limit_<<key>>>>
      all:
        label: <<smart_label>>
    schedule: <<schedule_<<key>>>>
    delete_not_scheduled: true
    sync_mode: <<sync_mode_<<key>>>>
    tmdb_collection: <<tmdb_collection_<<key>>>>
    tmdb_movie: <<tmdb_movie_<<key>>>>
    imdb_list: <<imdb_list_<<key>>>>
    trakt_list: <<trakt_list_<<key>>>>
    mdblist_list: <<mdblist_list_<<key>>>>
    cache_builders: 1
    translation_key: <<translation_key>>
    key_name: <<key_name>>
    summary: <<summary_<<key>>>>
    name: <<name_<<key>>>>
    limit: <<limit_<<key>>>>
    translation_prefix: <<emoji_<<key>>>>
gray hill
#

The defaults are a purpose-built framework. You can't just copy bits and pieces from them to use elsewhere. They have their own templates and all the other YAMLs are designed with those templates in mind, etc.

There's nothing magic in there, it's just an interwoven framework.

smoky swallow
#

sounds good. Thanks

gray hill
#

Anything further needed here?

untold wraith