??? blank "`type` &`data` - Used to specify the type of Dynamic Collection.<aclass="headerlink"href="#type-data"title="Permanent link">¶</a>"
<divid="type-data"/>Used to specify the type of Dynamic Collection and its data. `type` is required for every
dynamic collection and `data` is required for any type that uses the attribute.
<hrstyle="margin: 0px;">
**Attribute:**`type`&`data`
**Accepted Values:** See [Dynamic Collection Types & Data](dynamic_types.md)
??? blank "`exclude` - Used to exclude a list of keys from being created into collections.<aclass="headerlink"href="#exclude"title="Permanent link">¶</a>"
<divid="exclude"/>Used to exclude a list of `dynamic keys` from being created into collections.
<hrstyle="margin: 0px;">
**Attribute:**`exclude`
**Accepted Values:** List of keys
???+ example "Example"
For example when making a `genre` dynamic collection definition you can exclude "Horror" from having a
collection created from the key.
```yaml
dynamic_collections:
Genres: # mapping name does not matter, just needs to be unique
type: genre
exclude:
- Horror
```
??? blank "`addons` - Used to define how multiple keys can be combined under a parent key.<aclass="headerlink"href="#addons"title="Permanent link">¶</a>"
<divid="addons"/>Used to define how multiple `dynamic keys` can be combined under a parent key.
You can define custom parent keys under addons by just using the a key that doesnt exist; it will be considered a
1. Template variables are placed under `template_variables`.
2.`my_collection_poster` is the template variable being changed.
3. For key `119` use the url as the my_collection_poster template variable.
4. For key `531241` use the url as the my_collection_poster template variable.
??? blank "`remove_suffix` - Used to remove the defined suffixes.<aclass="headerlink"href="#remove-suffix"title="Permanent link">¶</a>"
<divid="remove-suffix"/>Used to remove the defined suffixes from the key before it’s used in the collection title.
<hrstyle="margin: 0px;">
**Attribute:**`remove_suffix`
**Accepted Values:** List or comma-separated string of suffixes to remove
???+ example "Example"
When using `type: tmdb_collection` you may not want every collection title to end with `Collection`.
```yaml
dynamic_collections:
TMDb Collections: # This name is the mapping name
type: tmdb_collection
remove_suffix: "Collection"
```
??? blank "`remove_prefix` - Used to remove the defined prefixes.<aclass="headerlink"href="#remove-prefix"title="Permanent link">¶</a>"
<divid="remove-prefix"/>Used to remove the defined prefixes from the key before it’s used in the collection title.
<hrstyle="margin: 0px;">
**Attribute:**`remove_prefix`
**Accepted Values:** List or comma-separated string of prefixes to remove
???+ example "Example"
When using `type: tmdb_collection` you may not want every collection title to start with `The`.
```yaml
dynamic_collections:
TMDb Collections: # This name is the mapping name
type: tmdb_collection
remove_prefix: "The"
```
??? blank "`title_format` - Used to specify the format you want the collection titles to be.<aclass="headerlink"href="#title-format"title="Permanent link">¶</a>"
<divid="title-format"/>Used to specify the format you want the collection titles to be.
There are a few special tags you can include in the `title_format`:
*`<<key_name>>` is **required** and is what will be replaced by the dynamic key name.
*`<<limit>>` will be replaced the limit template variable if passed to the definition.
*`<<library_type>>` will be replaced with either `movie`, `show`, `artist`, or `video` depending on your library
type.
*`<<library_typeU>>` will be replaced with either `Movie`, `Show`, `Artist`, or `Video` depending on your library
type.
<hrstyle="margin: 0px;">
**Attribute:**`title_format`
**Accepted Values:** String with `<<key_name>>` in it.
???+ example "Example"
```yaml
dynamic_collections:
Genres: # mapping name does not matter just needs to be unique
type: genre
title_format: Top 50 <<key_name>> <<library_type>>s
```
??? blank "`key_name_override` - Used to override key names before being formatted into titles.<aclass="headerlink"href="#key-name-override"title="Permanent link">¶</a>"
<divid="key-name-override"/>Defines how key names can be overridden before they are formatted into collection
This example uses `key_name_override` to change the formatting of "France" to "French" so that a collection can
be named "French Cinema" instead of simply "France".
* This particular example also uses the `title_format` attribute to manipulate the naming convention of the
collections.
```yaml
dynamic_collections:
Countries: # mapping name does not matter, just needs to be unique
type: country
title_format: <<key_name>> Cinema
key_name_override:
France: French
```
??? blank "`title_override` - Used to override titles ignoring title formatting.<aclass="headerlink"href="#title-override"title="Permanent link">¶</a>"
<divid="title-override"/>Defines how collection titles can be overridden ignoring title formatting.
This example will override the TMDb Star Wars collection which has an TMDb ID of `10` with `Star Wars Universe.
```yaml
dynamic_collections:
TMDb Collections: # mapping name does not matter, just needs to be unique
type: tmdb_collection
remove_suffix: "Collection"
title_override:
10: Star Wars Universe
```
??? blank "`custom_keys` - Used to allow the use of custom keys.<aclass="headerlink"href="#custom-keys"title="Permanent link">¶</a>"
<divid="custom-keys"/>Defines if custom keys are allowed. **Defaults to `true`**
<hrstyle="margin: 0px;">
**Attribute:**`custom_keys`
**Accepted Values:**`true` or `false`
???+ example "Example"
```yaml
dynamic_collections:
TMDb Collections: # mapping name does not matter, just needs to be unique
type: tmdb_collection
remove_suffix: "Collection"
custom_keys: false
```
??? blank "`test` - Used to run all collections in this set as tests.<aclass="headerlink"href="#test"title="Permanent link">¶</a>"
<divid="test"/>Used to run all collections in this set with `test: true` in each collection definition.
**Defaults to `fales`**
<hrstyle="margin: 0px;">
**Attribute:**`test`
**Accepted Values:**`true` or `false`
???+ example "Example"
```yaml
dynamic_collections:
Genres: # mapping name does not matter just needs to be unique
type: genre
test: true
```
??? blank "`sync` - Used to remove dynamic collections that are no longer in the creation list.<aclass="headerlink"href="#sync"title="Permanent link">¶</a>"
<divid="sync"/>Will remove dynamic collections that are no longer in the creation list. **Defaults to `fales`**
???+ warning
The mapping name is added as a label to any collection created using this dynamic collection set and because of
this when `sync` is true all collections with that label not found in this run will be deleted.
<hrstyle="margin: 0px;">
**Attribute:**`sync`
**Accepted Values:**`true` or `false`
???+ example "Example"
```yaml
dynamic_collections:
Trakt Liked Lists: # mapping name does not matter just needs to be unique
type: trakt_liked_lists
sync: true
```
??? blank "`include` - Used to define a specific list of keys to be made into collections.<aclass="headerlink"href="#include"title="Permanent link">¶</a>"
<divid="include"/>Define a list of keys to be made into collections.
???+ warning
This cannot be used with `exclude`.
???+ tip
Use with the `other_name` attribute to create a catch-all collection for all keys not in the `include` list or
in any [`addons`](#addons) list.
<hrstyle="margin: 0px;">
**Attribute:**`include`
**Accepted Values:**`true` or `false`
???+ example "Example"
```yaml
dynamic_collections:
Genres: # mapping name does not matter just needs to be unique
type: genre
include:
- Action
- Adventure
- Animation
- Comedy
- Family
- Fantasy
- Horror
- Romance
- Science Fiction
- War
```
??? blank "`other_name` - Used to create an "other" collection.<aclass="headerlink"href="#other-name"title="Permanent link">¶</a>"
<divid="other-name"/>Will create an "other" collection when also using the [`include`](#include) by specifying the
"other" collection's name as `other_name`. When defined, all keys not in [`include`](#include) or
[`addons`](#addons) will be combined into this collection.
<hrstyle="margin: 0px;">
**Attribute:**`other_name`
**Accepted Values:** String to make the "other" collection's name
???+ example "Example"
```yaml
dynamic_collections:
Genres: # mapping name does not matter just needs to be unique
type: genre
other_name: Other Genres
include:
- Action
- Adventure
- Animation
- Comedy
- Family
- Fantasy
- Horror
- Romance
- Science Fiction
- War
```
??? blank "`other_template` - Used to define which templates the dynamic other collection uses.<aclass="headerlink"href="#other-template"title="Permanent link">¶</a>"
<divid="other-template"/>Used to define which templates are used for the dynamic other collection when they need
to be different from the regular collection templates.
???+ tip
To use an other collection you must be using the [`include`](#include) and [`other_name`](#other-name)
attributes.
Each template is passed a few template variables you can use.
*`value`: The list of keys and addons
*`key`: The dynamic key
*`key_name`: The key after `key_name_override`, `remove_prefix`, or `remove_suffix` are run on it.
*`included_keys`: The list of included keys
*`used_keys`: The list of all keys used (included_keys and their addon keys)
<hrstyle="margin: 0px;">
**Attribute:**`other_template`
**Accepted Values:** Name of template or list of templates to use for the other collection only
???+ example "Example"
```yaml
templates:
Other:
plex_search:
any:
genre: <key>
summary: Other Genres found in the library.
dynamic_collections:
Genres: # mapping name does not matter just needs to be unique