diff --git a/VERSION b/VERSION index 13498a66..b5589522 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.16.3-develop7 +1.16.3-develop8 diff --git a/docs/metadata/builders/mdblist.md b/docs/metadata/builders/mdblist.md index a22f4b9a..6556c7f0 100644 --- a/docs/metadata/builders/mdblist.md +++ b/docs/metadata/builders/mdblist.md @@ -38,18 +38,21 @@ The default `sort_by` when it's not specified is `score.desc`. ### Sort Options -| Option | Description | -|:----------------------------------------|:-------------------------| -| `score.asc`
`score.desc` | Sort by MdbList Score | -| `released.asc`
`released.desc` | Sort by Release Date | -| `imdbrating.asc`
`imdbrating.desc` | Sort by IMDb Rating | -| `imdbvotes.asc`
`imdbvotes.desc` | Sort by IMDb Votes | -| `imdbpopular.asc`
`imdbpopular.desc` | Sort by IMDb Popular | -| `tmdbpopular.asc`
`tmdbpopular.desc` | Sort by TMDb Popular | -| `rogerebert.asc`
`rogerebert.desc` | Sort by RogerEvert Score | -| `budget.asc`
`budget.desc` | Sort by Budget | -| `revenue.asc`
`revenue.desc` | Sort by Revenue | -| `added.asc`
`added.desc` | Sort by Date Added | +| Option | Description | +|:----------------------------------------|:------------------------------| +| `score.asc`
`score.desc` | Sort by MdbList Score | +| `released.asc`
`released.desc` | Sort by Release Date | +| `imdbrating.asc`
`imdbrating.desc` | Sort by IMDb Rating | +| `imdbvotes.asc`
`imdbvotes.desc` | Sort by IMDb Votes | +| `imdbpopular.asc`
`imdbpopular.desc` | Sort by IMDb Popular | +| `tmdbpopular.asc`
`tmdbpopular.desc` | Sort by TMDb Popular | +| `rogerebert.asc`
`rogerebert.desc` | Sort by RogerEvert Score | +| `rtomatoes.asc`
`rtomatoes.desc` | Sort by Rotten Tomatoes Score | +| `metacritic.asc`
`metacritic.desc` | Sort by Metacritic Score | +| `myanimelist.asc`
`myanimelist.desc` | Sort by MyAnimeList Score | +| `budget.asc`
`budget.desc` | Sort by Budget | +| `revenue.asc`
`revenue.desc` | Sort by Revenue | +| `added.asc`
`added.desc` | Sort by Date Added | For these sorts to be reflected in your collection you must use `collection_order: custom`. diff --git a/docs/metadata/dynamic.md b/docs/metadata/dynamic.md index 398d098d..e659d7f8 100644 --- a/docs/metadata/dynamic.md +++ b/docs/metadata/dynamic.md @@ -88,6 +88,7 @@ dynamic_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. | ❌ | +| [`other_template`](#other-template) | Name of the template to use for the other collection. | ❌ | | [`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. | ❌ | @@ -513,11 +514,11 @@ Create a collection for each actor found in the library. Keys - TMDb Person ID + Person Name Key Names - TMDb Person Name + Person Name Default title_format @@ -529,10 +530,9 @@ Create a collection for each actor found in the library. ```yaml default_template: - tmdb_person: <> plex_search: - all: - actor: tmdb + any: + actor: <> ``` @@ -607,11 +607,11 @@ Create a collection for each director found in the library. Keys - TMDb Person ID + Person Name Key Names - TMDb Person Name + Person Name Default title_format @@ -623,10 +623,9 @@ Create a collection for each director found in the library. ```yaml default_template: - tmdb_person: <> plex_search: - all: - director: tmdb + any: + director: <> ``` @@ -701,11 +700,11 @@ Create a collection for each writer found in the library. Keys - TMDb Person ID + Person Name Key Names - TMDb Person Name + Person Name Default title_format @@ -717,10 +716,9 @@ Create a collection for each writer found in the library. ```yaml default_template: - tmdb_person: <> plex_search: - all: - writer: tmdb + any: + writer: <> ``` @@ -795,11 +793,11 @@ Create a collection for each producer found in the library. Keys - TMDb Person ID + Person Name Key Names - TMDb Person Name + Person Name Default title_format @@ -811,10 +809,9 @@ Create a collection for each producer found in the library. ```yaml default_template: - tmdb_person: <> plex_search: all: - producer: tmdb + producer: <> ``` @@ -1646,6 +1643,17 @@ dynamic_collections: 531241: https://www.themoviedb.org/t/p/original/nogV4th2P5QWYvQIMiWHj4CFLU9.jpg ``` +## Other Template + +Name of the template to use for the other collection. Will use the same template as the rest of the dynamic collections unless specified. + +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) + ## Remove Prefix/Suffix Removes the defined prefixes/suffixes from the key before it’s used in the collection title. diff --git a/docs/metadata/templates.md b/docs/metadata/templates.md index 62a9508c..54ccf53d 100644 --- a/docs/metadata/templates.md +++ b/docs/metadata/templates.md @@ -16,7 +16,7 @@ collections: Then you add another: -``` +```yaml collections: Bruce Lee: actor: tmdb @@ -52,14 +52,6 @@ The only things that change are the ID that is used with `tmdb_person` and the n Those two things surrounded by `<< >>` are "template variables" that you can define for any collection using this template, like this: -```yaml -collections: - Bruce Lee: - template: {name: Actor, person: 19429} -``` - -or as a list: - ```yaml collections: Chris Pratt: @@ -68,7 +60,15 @@ collections: person: 73457 ``` -Note that we provide the template name ["Actor"] and the value to insert in the place of `<>`. The `<>` is a required property of a collection, so it is always available and doesn't have to be called out like `<>`. +or to do it in a single line you can do this + +```yaml +collections: + Bruce Lee: + template: {name: Actor, person: 19429} +``` + +Note that we provide the template name `Actor` and the value to insert in the place of `<>`. The `<>` is a template variable that is always available and doesn't have to be called out like `<>`. Inside a template, you can use all the Builders, Details, and [Filters](filters) attributes that you can give collections/playlists [except `template`; templates cannot be nested]. @@ -95,13 +95,17 @@ collections: person: 73457 ``` -There are three attributes unique to `templates`, `default`, `optional`, and `move_prefix`. +There are three attributes unique to `templates`; `default`, `optional`, and `move_prefix`. * `default` can set default values for template variables to be used if they're not specified in the call. * `optional` can specify variables that if not specified on the template call will cause any attribute using one of those variables to be ignored in the template. You can make any template variable optional per collection by setting it to `null`. * `move_prefix` can be given a list or comma-separated string of prefixes to move to the end of the collection/playlist name for sorting. i.e. If you have `move_prefix: The` and a collection is called `The Avengers` then `<>` is replaced with `Avengers, The` instead of `The Avengers` for that collection. +Every template call is given either `<>` or `<>` and `<>` as template variables. + +All Template Variables can append `_encoded` to the variable name to use a URL encode version of the variable. ex. `<>` + Here's an example IMDb Genre template and two different ways to call it. ```yaml diff --git a/modules/meta.py b/modules/meta.py index b4380378..71e2fb71 100644 --- a/modules/meta.py +++ b/modules/meta.py @@ -408,6 +408,7 @@ class MetadataFile(DataFile): for role in roles: if person_count < person_limit and role["count"] > person_minimum and role["name"] not in exclude: auto_list[role["name"]] = role["name"] + all_keys.append(role["name"]) person_count += 1 default_template = {"plex_search": {"any": {auto_type: "<>"}}} elif auto_type == "trakt_user_lists":