[63] add tmdb_person_offset

pull/1309/head
meisnate12 2 years ago
parent 28ba768606
commit 80a2a4809a

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

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

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

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

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

@ -87,6 +87,23 @@ templates:
- 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:
default:
sort_by: release.desc
@ -94,12 +111,10 @@ templates:
limit_<<key>>: <<limit>>
search_value: <<value>>
optional:
- tmdb_person
- search_term2
- search_value2
- limit
- type
tmdb_person: <<tmdb_person>>
smart_filter:
sort_by: <<sort_by_<<key>>>>
limit: <<limit_<<key>>>>

@ -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.
![](../images/person_bw.png)
## Requirements & Recommendations
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. |
| `<<actor_name>>`<br>**Example:** `Frank Welker` | `<<actor_name>>`<br>**Example:** `Frank Welker` | Collection of Movies/Shows the actor is top billing in. |
### 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)
```{include} ../people.md
```
## 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 |
| `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. |
| `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.
@ -85,4 +70,6 @@ libraries:
sort_by: title.asc
use_separator: false
sep_style: purple
tmdb_person_offset:
Richard Brooks: 1
```

@ -2,8 +2,6 @@
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
Supported Library Types: Movie
@ -15,21 +13,8 @@ Supported Library Types: Movie
| `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. |
### 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)
```{include} ../people.md
```
## 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 |
| `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. |
| `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.
@ -81,4 +67,6 @@ libraries:
depth: 10
limit: 20
sort_by: title.asc
tmdb_person_offset:
Richard Brooks: 1
```

@ -2,8 +2,6 @@
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
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_name>>`<br>**Example:** `Frank Welker` | `<<producer_name>>`<br>**Example:** `Frank Welker` | Collection of Movies by th Producer. |
### 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)
```{include} ../people.md
```
## 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 |
| `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. |
| `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.
@ -81,4 +67,6 @@ libraries:
depth: 10
limit: 20
sort_by: title.asc
tmdb_person_offset:
Richard Brooks: 1
```

@ -2,8 +2,6 @@
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
Supported Library Types: Movie
@ -15,21 +13,8 @@ Supported Library Types: Movie
| `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. |
### 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)
```{include} ../people.md
```
## 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 |
| `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. |
| `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.
@ -81,4 +67,6 @@ libraries:
depth: 10
limit: 20
sort_by: title.asc
tmdb_person_offset:
Charles Bennett: 1
```

@ -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)

@ -7,6 +7,7 @@ All the following attributes update various details of the definition's Metadata
| 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_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 |
| `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 |

@ -590,6 +590,12 @@ class CollectionBuilder:
else:
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:
logger.debug("")
logger.debug("Validating Method: tmdb_person")
@ -613,11 +619,12 @@ class CollectionBuilder:
try:
results = self.config.TMDb.search_people(tmdb_person)
if results:
result_index = len(results) - 1 if self.tmdb_person_offset >= len(results) else self.tmdb_person_offset
valid_names.append(tmdb_person)
if results[0].biography:
self.summaries["tmdb_person"] = results[0].biography
if results[0].profile_url:
self.posters["tmdb_person"] = results[0].profile_url
if results[result_index].biography:
self.summaries["tmdb_person"] = results[result_index].biography
if results[result_index].profile_url:
self.posters["tmdb_person"] = results[result_index].profile_url
except Failed as ee:
logger.error(ee)
if len(valid_names) > 0:

@ -987,7 +987,11 @@ class MetadataFile(DataFile):
used_keys.extend(key_value)
og_call = {"value": key_value, auto_type: key_value, "key_name": key_name, "key": key}
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]
elif "default" in v:
og_call[k] = v["default"]
@ -1018,6 +1022,10 @@ class MetadataFile(DataFile):
auto_type: other_keys, "key_name": other_name, "key": "other"
}
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:
og_other[k] = v["other"]
elif "default" in v:

Loading…
Cancel
Save