[63] add tmdb_person_offset

This commit is contained in:
meisnate12 2023-02-07 11:50:18 -05:00
parent 28ba768606
commit 80a2a4809a
14 changed files with 96 additions and 85 deletions

View file

@ -1 +1 @@
1.18.3-develop62 1.18.3-develop63

View file

@ -30,12 +30,15 @@ dynamic_collections:
limit: 25 limit: 25
title_format: <<key_name>> title_format: <<key_name>>
template: template:
- tmdb_person
- smart_filter - smart_filter
- translation - translation
- shared - shared
template_variables: template_variables:
tmdb_person: tmdb_person:
default: <<value>> default: <<value>>
tmdb_person_offset:
default: 0
search_term: search_term:
default: actor default: actor
search_value: search_value:
@ -44,5 +47,3 @@ dynamic_collections:
default: actor default: actor
style: style:
default: bw default: bw
url_poster:
default: https://raw.githubusercontent.com/meisnate12/Plex-Meta-Manager-People-<<style>>/master/<<key_name_first_letter>>/Images/<<key_encoded>>.jpg

View file

@ -30,12 +30,16 @@ dynamic_collections:
limit: 25 limit: 25
title_format: <<key_name>> (Director) title_format: <<key_name>> (Director)
template: template:
- tmdb_person
- smart_filter - smart_filter
- translation - translation
- shared - shared
template_variables: template_variables:
tmdb_person: tmdb_person:
default: <<value>> default: <<value>>
tmdb_person_offset:
default: 0
Richard Brooks: 1
search_term: search_term:
default: director default: director
search_value: search_value:
@ -44,5 +48,3 @@ dynamic_collections:
default: director default: director
style: style:
default: bw default: bw
url_poster:
default: https://raw.githubusercontent.com/meisnate12/Plex-Meta-Manager-People-<<style>>/master/<<key_name_first_letter>>/Images/<<key_encoded>>.jpg

View file

@ -30,12 +30,15 @@ dynamic_collections:
depth: 5 depth: 5
limit: 25 limit: 25
template: template:
- tmdb_person
- smart_filter - smart_filter
- translation - translation
- shared - shared
template_variables: template_variables:
tmdb_person: tmdb_person:
default: <<value>> default: <<value>>
tmdb_person_offset:
default: 0
search_term: search_term:
default: producer default: producer
search_value: search_value:
@ -44,5 +47,3 @@ dynamic_collections:
default: producer default: producer
style: style:
default: bw default: bw
url_poster:
default: https://raw.githubusercontent.com/meisnate12/Plex-Meta-Manager-People-<<style>>/master/<<key_name_first_letter>>/Images/<<key_encoded>>.jpg

View file

@ -30,12 +30,16 @@ dynamic_collections:
limit: 25 limit: 25
title_format: <<key_name>> (Writer) title_format: <<key_name>> (Writer)
template: template:
- tmdb_person
- smart_filter - smart_filter
- translation - translation
- shared - shared
template_variables: template_variables:
tmdb_person: tmdb_person:
default: <<value>> default: <<value>>
tmdb_person_offset:
default: 0
Charles Bennett: 1
search_term: search_term:
default: writer default: writer
search_value: search_value:
@ -44,5 +48,3 @@ dynamic_collections:
default: writer default: writer
style: style:
default: bw default: bw
url_poster:
default: https://raw.githubusercontent.com/meisnate12/Plex-Meta-Manager-People-<<style>>/master/<<key_name_first_letter>>/Images/<<key_encoded>>.jpg

View file

@ -87,6 +87,23 @@ templates:
- imdb_list - imdb_list
imdb_list: <<imdb_list>> imdb_list: <<imdb_list>>
tmdb_person:
default:
url_poster: https://raw.githubusercontent.com/meisnate12/Plex-Meta-Manager-People-<<style>>/master/<<key_name_first_letter>>/Images/<<key_encoded>><<extra>>.jpg
url_poster_<<key>>: <<url_poster>>
optional:
- tmdb_person
- tmdb_person_offset
tmdb_person: <<tmdb_person>>
tmdb_person_offset: <<tmdb_person_offset>>
conditionals:
extra:
default: ""
conditions:
- tmdb_person_offset.exists: true
tmdb_person_offset.not: 0
value: " (<<tmdb_person_offset>>)"
smart_filter: smart_filter:
default: default:
sort_by: release.desc sort_by: release.desc
@ -94,12 +111,10 @@ templates:
limit_<<key>>: <<limit>> limit_<<key>>: <<limit>>
search_value: <<value>> search_value: <<value>>
optional: optional:
- tmdb_person
- search_term2 - search_term2
- search_value2 - search_value2
- limit - limit
- type - type
tmdb_person: <<tmdb_person>>
smart_filter: smart_filter:
sort_by: <<sort_by_<<key>>>> sort_by: <<sort_by_<<key>>>>
limit: <<limit_<<key>>>> limit: <<limit_<<key>>>>

View file

@ -2,8 +2,6 @@
The `actor` Default Metadata File is used to dynamically create collections based on the most popular actors/actresses in your library. The `actor` Default Metadata File is used to dynamically create collections based on the most popular actors/actresses in your library.
![](../images/person_bw.png)
## Requirements & Recommendations ## Requirements & Recommendations
Supported Library Types: Movie, Show Supported Library Types: Movie, Show
@ -15,22 +13,8 @@ Supported Library Types: Movie, Show
| `Actors Collections` | `separator` | [Separator Collection](../separators) to denote the Section of Collections. | | `Actors Collections` | `separator` | [Separator Collection](../separators) to denote the Section of Collections. |
| `<<actor_name>>`<br>**Example:** `Frank Welker` | `<<actor_name>>`<br>**Example:** `Frank Welker` | Collection of Movies/Shows the actor is top billing in. | | `<<actor_name>>`<br>**Example:** `Frank Welker` | `<<actor_name>>`<br>**Example:** `Frank Welker` | Collection of Movies/Shows the actor is top billing in. |
### Rainier Style ```{include} ../people.md
```
![](../images/person_rainier.png)
### Signature Style
![](../images/person_signature.png)
### Diivoy Style
![](../images/person_diivoy.png)
### Diivoy Color Style
![](../images/person_diivoycolor.png)
## Config ## Config
@ -67,6 +51,7 @@ This file contains a [Separator](../separators) so all [Shared Separator Variabl
| `exclude` | **Description:** Exclude these Actors from creating a Dynamic Collection.<br>**Values:** List of Actor Names | | `exclude` | **Description:** Exclude these Actors from creating a Dynamic Collection.<br>**Values:** List of Actor Names |
| `actor_name` | **Description:** Changes the title format of the Dynamic Collections.<br>**Default:** `<<key_name>>`<br>**Values:** Any string with `<<key_name>>` in it. | | `actor_name` | **Description:** Changes the title format of the Dynamic Collections.<br>**Default:** `<<key_name>>`<br>**Values:** Any string with `<<key_name>>` in it. |
| `actor_summary` | **Description:** Changes the summary format of the Dynamic Collections.<br>**Default:** `<<library_translationU>>s with <<key_name>>.`<br>**Values:** Any string with `<<key_name>>` in it. | | `actor_summary` | **Description:** Changes the summary format of the Dynamic Collections.<br>**Default:** `<<library_translationU>>s with <<key_name>>.`<br>**Values:** Any string with `<<key_name>>` in it. |
| `tmdb_person_offset` | **Description:** Changes the summary `tmdb_person_offset` for specific People.<br>**Default:** `0`<br>**Values:** Dictionary of Actor Name as the keys and the `tmdb_person_offset` as the value. |
1. Each default collection has a `key` that when calling to effect a specific collection you must replace `<<key>>` with when calling. 1. Each default collection has a `key` that when calling to effect a specific collection you must replace `<<key>>` with when calling.
@ -85,4 +70,6 @@ libraries:
sort_by: title.asc sort_by: title.asc
use_separator: false use_separator: false
sep_style: purple sep_style: purple
tmdb_person_offset:
Richard Brooks: 1
``` ```

View file

@ -2,8 +2,6 @@
The `director` Default Metadata File is used to dynamically create collections based on the most popular directors in your library. The `director` Default Metadata File is used to dynamically create collections based on the most popular directors in your library.
![](../images/person_bw.png)
## Requirements & Recommendations ## Requirements & Recommendations
Supported Library Types: Movie Supported Library Types: Movie
@ -15,21 +13,8 @@ Supported Library Types: Movie
| `Directors Collections` | `separator` | [Separator Collection](../separators) to denote the Section of Collections. | | `Directors Collections` | `separator` | [Separator Collection](../separators) to denote the Section of Collections. |
| `<<director_name>>`<br>**Example:** `Frank Welker` | `<<director_name>>`<br>**Example:** `Frank Welker` | Collection of Movies by the Director. | | `<<director_name>>`<br>**Example:** `Frank Welker` | `<<director_name>>`<br>**Example:** `Frank Welker` | Collection of Movies by the Director. |
### Rainier Style ```{include} ../people.md
```
![](../images/person_rainier.png)
### Signature Style
![](../images/person_signature.png)
### Diivoy Style
![](../images/person_diivoy.png)
### Diivoy Color Style
![](../images/person_diivoycolor.png)
## Config ## Config
@ -63,6 +48,7 @@ This file contains a [Separator](../separators) so all [Shared Separator Variabl
| `exclude` | **Description:** Exclude these Directors from creating a Dynamic Collection.<br>**Values:** List of Director Names | | `exclude` | **Description:** Exclude these Directors from creating a Dynamic Collection.<br>**Values:** List of Director Names |
| `director_name` | **Description:** Changes the title format of the Dynamic Collections.<br>**Default:** `<<key_name>> (Director)`<br>**Values:** Any string with `<<key_name>>` in it. | | `director_name` | **Description:** Changes the title format of the Dynamic Collections.<br>**Default:** `<<key_name>> (Director)`<br>**Values:** Any string with `<<key_name>>` in it. |
| `director_summary` | **Description:** Changes the summary format of the Dynamic Collections.<br>**Default:** `<<library_translationU>>s directed by <<key_name>>.`<br>**Values:** Any string with `<<key_name>>` in it. | | `director_summary` | **Description:** Changes the summary format of the Dynamic Collections.<br>**Default:** `<<library_translationU>>s directed by <<key_name>>.`<br>**Values:** Any string with `<<key_name>>` in it. |
| `tmdb_person_offset` | **Description:** Changes the summary tmdb_person_offset for specific People.<br>**Default:** `0`<br>**Values:** Dictionary of Actor Name as the keys and the tmdb_person_offset as the value. |
1. Each default collection has a `key` that when calling to effect a specific collection you must replace `<<key>>` with when calling. 1. Each default collection has a `key` that when calling to effect a specific collection you must replace `<<key>>` with when calling.
@ -81,4 +67,6 @@ libraries:
depth: 10 depth: 10
limit: 20 limit: 20
sort_by: title.asc sort_by: title.asc
tmdb_person_offset:
Richard Brooks: 1
``` ```

View file

@ -2,8 +2,6 @@
The `producer` Default Metadata File is used to dynamically create collections based on the most popular producers in your library. The `producer` Default Metadata File is used to dynamically create collections based on the most popular producers in your library.
![](../images/person_bw.png)
## Requirements & Recommendations ## Requirements & Recommendations
Supported Library Types: Movie Supported Library Types: Movie
@ -15,21 +13,8 @@ Supported Library Types: Movie
| `Producer Collections` | `separator` | [Separator Collection](../separators) to denote the Section of Collections. | | `Producer Collections` | `separator` | [Separator Collection](../separators) to denote the Section of Collections. |
| `<<producer_name>>`<br>**Example:** `Frank Welker` | `<<producer_name>>`<br>**Example:** `Frank Welker` | Collection of Movies by th Producer. | | `<<producer_name>>`<br>**Example:** `Frank Welker` | `<<producer_name>>`<br>**Example:** `Frank Welker` | Collection of Movies by th Producer. |
### Rainier Style ```{include} ../people.md
```
![](../images/person_rainier.png)
### Signature Style
![](../images/person_signature.png)
### Diivoy Style
![](../images/person_diivoy.png)
### Diivoy Color Style
![](../images/person_diivoycolor.png)
## Config ## Config
@ -63,6 +48,7 @@ This file contains a [Separator](../separators) so all [Shared Separator Variabl
| `exclude` | **Description:** Exclude these Producers from creating a Dynamic Collection.<br>**Values:** List of Producer Names | | `exclude` | **Description:** Exclude these Producers from creating a Dynamic Collection.<br>**Values:** List of Producer Names |
| `producer_name` | **Description:** Changes the title format of the Dynamic Collections.<br>**Default:** `<<key_name>> (Producer)`<br>**Values:** Any string with `<<key_name>>` in it. | | `producer_name` | **Description:** Changes the title format of the Dynamic Collections.<br>**Default:** `<<key_name>> (Producer)`<br>**Values:** Any string with `<<key_name>>` in it. |
| `producer_summary` | **Description:** Changes the summary format of the Dynamic Collections.<br>**Default:** `<<library_translationU>>s produced by <<key_name>>.`<br>**Values:** Any string with `<<key_name>>` in it. | | `producer_summary` | **Description:** Changes the summary format of the Dynamic Collections.<br>**Default:** `<<library_translationU>>s produced by <<key_name>>.`<br>**Values:** Any string with `<<key_name>>` in it. |
| `tmdb_person_offset` | **Description:** Changes the summary tmdb_person_offset for specific People.<br>**Default:** `0`<br>**Values:** Dictionary of Actor Name as the keys and the tmdb_person_offset as the value. |
1. Each default collection has a `key` that when calling to effect a specific collection you must replace `<<key>>` with when calling. 1. Each default collection has a `key` that when calling to effect a specific collection you must replace `<<key>>` with when calling.
@ -81,4 +67,6 @@ libraries:
depth: 10 depth: 10
limit: 20 limit: 20
sort_by: title.asc sort_by: title.asc
tmdb_person_offset:
Richard Brooks: 1
``` ```

View file

@ -2,8 +2,6 @@
The `writer` Default Metadata File is used to dynamically create collections based on the most popular writers in your library. The `writer` Default Metadata File is used to dynamically create collections based on the most popular writers in your library.
![](../images/writer1.png)
## Requirements & Recommendations ## Requirements & Recommendations
Supported Library Types: Movie Supported Library Types: Movie
@ -15,21 +13,8 @@ Supported Library Types: Movie
| `Writers Collections` | `separator` | [Separator Collection](../separators) to denote the Section of Collections. | | `Writers Collections` | `separator` | [Separator Collection](../separators) to denote the Section of Collections. |
| `<<writer_name>>`<br>**Example:** `Frank Welker` | `<<writer_name>>`<br>**Example:** `Frank Welker` | Collection of Movies by the Writer. | | `<<writer_name>>`<br>**Example:** `Frank Welker` | `<<writer_name>>`<br>**Example:** `Frank Welker` | Collection of Movies by the Writer. |
### Rainier Style ```{include} ../people.md
```
![](../images/person_rainier.png)
### Signature Style
![](../images/person_signature.png)
### Diivoy Style
![](../images/person_diivoy.png)
### Diivoy Color Style
![](../images/person_diivoycolor.png)
## Config ## Config
@ -63,6 +48,7 @@ This file contains a [Separator](../separators) so all [Shared Separator Variabl
| `exclude` | **Description:** Exclude these Writers from creating a Dynamic Collection.<br>**Values:** List of Writer Names | | `exclude` | **Description:** Exclude these Writers from creating a Dynamic Collection.<br>**Values:** List of Writer Names |
| `writer_name` | **Description:** Changes the title format of the Dynamic Collections.<br>**Default:** `<<key_name>> (Writer)`<br>**Values:** Any string with `<<key_name>>` in it. | | `writer_name` | **Description:** Changes the title format of the Dynamic Collections.<br>**Default:** `<<key_name>> (Writer)`<br>**Values:** Any string with `<<key_name>>` in it. |
| `writer_summary` | **Description:** Changes the summary format of the Dynamic Collections.<br>**Default:** `<<library_translationU>>s written by <<key_name>>.`<br>**Values:** Any string with `<<key_name>>` in it. | | `writer_summary` | **Description:** Changes the summary format of the Dynamic Collections.<br>**Default:** `<<library_translationU>>s written by <<key_name>>.`<br>**Values:** Any string with `<<key_name>>` in it. |
| `tmdb_person_offset` | **Description:** Changes the summary tmdb_person_offset for specific People.<br>**Default:** `0`<br>**Values:** Dictionary of Actor Name as the keys and the tmdb_person_offset as the value. |
1. Each default collection has a `key` that when calling to effect a specific collection you must replace `<<key>>` with when calling. 1. Each default collection has a `key` that when calling to effect a specific collection you must replace `<<key>>` with when calling.
@ -81,4 +67,6 @@ libraries:
depth: 10 depth: 10
limit: 20 limit: 20
sort_by: title.asc sort_by: title.asc
tmdb_person_offset:
Charles Bennett: 1
``` ```

23
docs/defaults/people.md Normal file
View file

@ -0,0 +1,23 @@
## Poster Styles
This Default can use the `style` template variable to easily change the posters styles.
### Black & White Style (Default)
![](../images/person_bw.png)
### Rainier Style
![](../images/person_rainier.png)
### Signature Style
![](../images/person_signature.png)
### Diivoy Style
![](../images/person_diivoy.png)
### Diivoy Color Style
![](../images/person_diivoycolor.png)

View file

@ -7,6 +7,7 @@ All the following attributes update various details of the definition's Metadata
| Attribute | Description & Values | | Attribute | Description & Values |
|:-----------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |:-----------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `tmdb_person` | **Description:** Changes summary and poster to a TMDb Person's biography and profile as well as allow the people specified to be used in [Plex Searches](../builders/plex.md#plex-search).<br>**Values:** TMDb Person ID (List or Comma-separated string) | | `tmdb_person` | **Description:** Changes summary and poster to a TMDb Person's biography and profile as well as allow the people specified to be used in [Plex Searches](../builders/plex.md#plex-search).<br>**Values:** TMDb Person ID (List or Comma-separated string) |
| `tmdb_person_offset` | **Description:** Offsets which search results are used by `tmdb_person`.<br>**Values:** Any Number greater then 0<br>**Default:** 0 |
| `sort_title` | **Description:** Changes the sort title.<br>You can "promote" certain collections to the top of a library by creating a sort title starting with a `+` or "demote" certain collections to the bottom of a library by creating a sort title starting with a `~`.<br>**Values:** Text to change Sort Title | | `sort_title` | **Description:** Changes the sort title.<br>You can "promote" certain collections to the top of a library by creating a sort title starting with a `+` or "demote" certain collections to the bottom of a library by creating a sort title starting with a `~`.<br>**Values:** Text to change Sort Title |
| `content_rating` | **Description:** Changes the content rating.<br>**Values:** Text to change Content Rating | | `content_rating` | **Description:** Changes the content rating.<br>**Values:** Text to change Content Rating |
| `label` | **Description:** Appends new labels.<br>**Values:** Comma-separated string of labels to append | | `label` | **Description:** Appends new labels.<br>**Values:** Comma-separated string of labels to append |

View file

@ -590,6 +590,12 @@ class CollectionBuilder:
else: else:
self.sync = self.data[methods["sync_mode"]].lower() == "sync" self.sync = self.data[methods["sync_mode"]].lower() == "sync"
if "tmdb_person_offset" in methods:
logger.debug("")
logger.debug("Validating Method: tmdb_person_offset")
logger.debug(f"Value: {data[methods['tmdb_person_offset']]}")
self.tmdb_person_offset = util.parse(self.Type, "tmdb_person_offset", self.data, datatype="int", methods=methods, default=0, minimum=0)
if "tmdb_person" in methods: if "tmdb_person" in methods:
logger.debug("") logger.debug("")
logger.debug("Validating Method: tmdb_person") logger.debug("Validating Method: tmdb_person")
@ -613,11 +619,12 @@ class CollectionBuilder:
try: try:
results = self.config.TMDb.search_people(tmdb_person) results = self.config.TMDb.search_people(tmdb_person)
if results: if results:
result_index = len(results) - 1 if self.tmdb_person_offset >= len(results) else self.tmdb_person_offset
valid_names.append(tmdb_person) valid_names.append(tmdb_person)
if results[0].biography: if results[result_index].biography:
self.summaries["tmdb_person"] = results[0].biography self.summaries["tmdb_person"] = results[result_index].biography
if results[0].profile_url: if results[result_index].profile_url:
self.posters["tmdb_person"] = results[0].profile_url self.posters["tmdb_person"] = results[result_index].profile_url
except Failed as ee: except Failed as ee:
logger.error(ee) logger.error(ee)
if len(valid_names) > 0: if len(valid_names) > 0:

View file

@ -987,7 +987,11 @@ class MetadataFile(DataFile):
used_keys.extend(key_value) used_keys.extend(key_value)
og_call = {"value": key_value, auto_type: key_value, "key_name": key_name, "key": key} og_call = {"value": key_value, auto_type: key_value, "key_name": key_name, "key": key}
for k, v in template_variables.items(): for k, v in template_variables.items():
if key in v: if k in self.temp_vars and key in self.temp_vars[k]:
og_call[k] = self.temp_vars[k][key]
elif k in self.temp_vars and "default" in self.temp_vars[k]:
og_call[k] = self.temp_vars[k]["default"]
elif key in v:
og_call[k] = v[key] og_call[k] = v[key]
elif "default" in v: elif "default" in v:
og_call[k] = v["default"] og_call[k] = v["default"]
@ -1018,6 +1022,10 @@ class MetadataFile(DataFile):
auto_type: other_keys, "key_name": other_name, "key": "other" auto_type: other_keys, "key_name": other_name, "key": "other"
} }
for k, v in template_variables.items(): for k, v in template_variables.items():
if k in self.temp_vars and "other" in self.temp_vars[k]:
og_other[k] = self.temp_vars[k]["other"]
elif k in self.temp_vars and "default" in self.temp_vars[k]:
og_other[k] = self.temp_vars[k]["default"]
if "other" in v: if "other" in v:
og_other[k] = v["other"] og_other[k] = v["other"]
elif "default" in v: elif "default" in v: