* Collections based on the Collections from TMDb for every item in the library. ([Star Wars](https://www.themoviedb.org/collection/10-star-wars-collection), [Harry Potter](https://www.themoviedb.org/collection/1241), etc...)
* Collections based on each of a Users Trakt Lists
* Collections for the top `X` popular people on TMDb (Bruce Willis, Tom Hanks, etc...)
* Collections for each decade represented in the library (Best of 1990s, Best of 2000s, etc...)
* Collections for each of the moods/styles within a Music library (A Cappella, Pop Rock, etc...)
The main purpose of dynamic collections is to automate the creation of collections which would otherwise require considerable user input and repetition (such as creating a collection for every genre).
Each dynamic collection must have a mapping name (just like standard collections), which is also attached to the collection as a label to mark it as having been created by this dynamic collection.
This example will create a collection for every TMDb Collection associated with items in the library.
```yaml
dynamic_collections:
TMDb Collections: # This name is the mapping name
type: tmdb_collections
remove_suffix: "Collection"
```
## Collection Naming
By default, the collections generated will be named for the thing being used to create them; things like genres, countries, actors or even Trakt List Names.
There are many attributes that can change the titles, including `title_format`, `remove_suffix`, `remove_prefix`, `pre_format_override`, and `post_format_override` all detailed below.
A `dynamic key` or `key` for short is used to refer to a specific value/result from the dynamic collection criteria that will be used to create the collection.
* Using the `pre_format_override` attribute 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: <<country>> Cinema
pre_format_override:
France: French
```
* Using the `addons` attribute to combine multiple `keys`, i.e. merging "MTV", "MTV2", "MTV3" and "MTV (UK)" into one "MTV Worldwide" collection.
* When doing this, individual collections will not be created for the individual MTV collections, instead they will be merged within the "MTV Worldwide" collection.
| [`type`](#type--data) | Type of Dynamic Collection to be created. | ✅ |
| [`data`](#type--data) | Data to determine how dynamic collections with a certain `type` are created. | Depends on `type` |
| [`exclude`](#exclude) | Exclude this list of keys from being created into collections. | ❌ |
| [`addons`](#addons) | Defines how multiple keys can be combined under a parent key. | ❌ |
| [`template`](#template) | Name of the template to use for these dynamic collections. | ❌ |
| [`template_variables`](#template-variables) | Defines how template variables can be defined by key. | ❌ |
| [`remove_suffix`](#remove-prefixsuffix) | Removes the defined suffixes from the key before it's used in the collection title. | ❌ |
| [`remove_prefix`](#remove-prefixsuffix) | Removes the defined prefixes from the key before it's used in the collection title. | ❌ |
| [`title_format`](#title-format) | This is the format for the collection titles. | ❌ |
| [`pre_format_override`](#pre-format-override) | Defines how titles can be overridden before they are formatted into collection titles. | ❌ |
| [`post_format_override`](#post-format-override) | Defines how collection titles can be overridden ignoring title formatting. | ❌ |
| [`test`](#test) | Will add `test: true` to all collections for test runs. | ❌ |
| [`sync`](#sync) | Will remove dynamic collections that are no longer in the creation list. | ❌ |
| [`include`](#include) | Define a list of keys to be made into collections. | ❌ |
| [`other_name`](#other-name) | Used in combination with `include`. When defined, all keys not in `include` or `addons` will be combined into this collection. | ❌ |
## Type & Data
Specifies the type of dynamic collection to be created.
Depending on the `type` of dynamic collection, `data` is used to specify the options that are required to fulfill the requirements of creating the collection.
| Type Option | Description | Uses<br>`data` | Movies | Shows | Music | Video |
| [`tmdb_collection`](#tmdb-collection) | Create a collection for each TMDb Collection associated with an item in the library | ❌ | ✅ | ❌ | ❌ | ❌ |
| [`tmdb_popular_people`](#tmdb-popular-people) | Create a collection for each actor found on [TMDb's Popular People List](https://www.themoviedb.org/person) | ✅ | ✅ | ✅ | ❌ | ❌ |
| [`original_language`](#original-language) | Create a collection for each TMDb original language associated with an item in the library | ❌ | ✅ | ✅ | ❌ | ❌ |
| [`trakt_user_lists`](#trakt-user-lists) | Create a collection for each list from specific trakt users | ✅ | ✅ | ✅ | ❌ | ❌ |
| [`trakt_liked_lists`](#trakt-liked-lists) | Create a collection for each list the authenticated trakt user likes | ❌ | ✅ | ✅ | ❌ | ❌ |
| [`trakt_people_list`](#trakt-people-lists) | Create a collection for each actor found in the trakt list | ✅ | ✅ | ✅ | ❌ | ❌ |
| [`actor`](#actor) | Create a collection for each actor found in the library | ✅ | ✅ | ✅ | ❌ | ❌ |
* The `pre_format_override` attribute is used here in combination with the `title_format` to change the collection name from "France" which would be the default title, to "Top French Cinema"
Exclude this list of `keys` from being created into collections.
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
```
## Addons
Defines how multiple `keys` can be combined under a parent key.
For example, the `addons` attribute can be used to combine multiple `keys`, i.e. merging "MTV", "MTV2", "MTV3" and "MTV (UK)" into one "MTV Worldwide" collection.
* When doing this, individual collections will not be created for the individual MTV collections, instead they will be merged within the "MTV Worldwide" collection.
Name of the template to use for these dynamic collections. Each `type` has its own default template, but if you want to define and use your own template you can.
For example, the template below removes the limit on the `smart_filter` so it shows all items in each network
```yaml
templates:
network collection:
smart_filter:
sort_by: critic_rating.desc
all:
network: <<network>>
dynamic_collections:
Networks: # mapping name does not matter just needs to be unique
Defines how titles can be overridden before they are formatted into collection titles.
This example uses the `pre_format_override` attribute 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
Will add `test: true` to all collections for test runs.
Here's an example using `test`.
```yaml
dynamic_collections:
Genres: # mapping name does not matter just needs to be unique
type: genre
test: true
```
## Sync
Will remove dynamic collections that are no longer in the creation list.
The mapping name is added as a label to any collection created using dynamic and because of this when `sync` is true all collections with that label not found in this run will be deleted.
Here's an example using `sync`.
```yaml
dynamic_collections:
Trakt Liked Lists: # mapping name does not matter just needs to be unique
type: trakt_liked_lists
sync: true
```
## Include
Define a list of keys to be made into collections.
This cannot be used with `exclude`.
Here's an example using `include`.
```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
```
## Other Name
Used in combination with `include`. When defined, all keys not in `include` or `addons` will be combined into this collection.
This is the main reason to use `include`. It allows a catch all collection for everything not defined in the config file.
Here's an example using `other_name`.
```yaml
dynamic_collections:
Genres: # mapping name does not matter just needs to be unique