Merge branch 'meisnate12:nightly' into nightly

pull/1305/head
johnfawkes 2 years ago committed by GitHub
commit 3dcd21fc19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1 +1 @@
1.18.3-develop58
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>>>>

@ -35,6 +35,7 @@ radarr:
| `add_missing` | Adds all missing movies found from all collections to Radarr.<br>Use the `radarr_add_missing` [Radarr Details](../metadata/details/arr.md#radarr-definition-settings) in the collection definition to add missing per collection.<br>**boolean:** true or false | false | &#10060; |
| `add_existing` | Adds all existing movies in collections to Radarr.<br>Use the `radarr_add_existing` [Radarr Details](../metadata/details/arr.md#radarr-definition-settings) in the collection definition to add existing per collection.<br>**boolean:** true or false | false | &#10060; |
| `upgrade_existing` | Upgrades all existing movies in collections to match the Quality Profile of the collection.<br>Use the `radarr_upgrade_existing` [Radarr Details](../metadata/details/arr.md#radarr-definition-settings) in the collection definition to upgrade the Quality Profile per collection.<br>**boolean:** true or false | false | &#10060; |
| `ignore_cache` | Ignores PMM's cache when adding items to Radarr.<br>Use the `radarr_ignore_cache` [Radarr Details](../metadata/details/arr.md#radarr-definition-settings) in the collection definition to ignore per collection.<br>**boolean:** true or false | false | &#10060; |
| `root_folder_path` | Default Root Folder Path to use when adding new movies.<br>Use the `radarr_folder` [Radarr Details](../metadata/details/arr.md#radarr-definition-settings) in the collection definition to set the Root Folder per collection. | N/A | &#9989; |
| `monitor` | Monitor the movie when adding new movies.<br>Use the `radarr_monitor` [Radarr Details](../metadata/details/arr.md#radarr-definition-settings) in the collection definition to set the Monitor value per collection.<br>**Options:** `movie`, `collection`, `none` | true | &#10060; |
| `availability` | Default Minimum Availability to use when adding new movies.<br>Use the `radarr_availability` [Radarr Details](../metadata/details/arr.md#radarr-definition-settings) in the collection definition to set the Availability per collection.<br>**Options:** `announced`, `cinemas`, `released`, `db` | `announced` | &#9989; |

@ -38,6 +38,7 @@ sonarr:
| `add_missing` | Adds all missing shows found from all collections to Sonarr.<br>Use the `sonarr_add_missing` [Sonarr Details](../metadata/details/arr.md#sonarr-definition-settings) in the collection definition to add missing per collection.<br>**boolean:** true or false | false | &#10060; |
| `add_existing` | Adds all existing shows in collections to Sonarr.<br>Use the `sonarr_add_existing` [Sonarr Details](../metadata/details/arr.md#sonarr-definition-settings) in the collection definition to add existing per collection.<br>**boolean:** true or false | false | &#10060; |
| `upgrade_existing` | Upgrades all existing shows in collections to match the Quality Profile of the collection.<br>Use the `sonarr_upgrade_existing` [Sonarr Details](../metadata/details/arr.md#sonarr-definition-settings) in the collection definition to upgrade the Quality Profile per collection.<br>**boolean:** true or false | false | &#10060; |
| `ignore_cache` | Ignores PMM's cache when adding items to Sonarr.<br>Use the `sonarr_ignore_cache` [Sonarr Details](../metadata/details/arr.md#sonarr-definition-settings) in the collection definition to ignore per collection.<br>**boolean:** true or false | false | &#10060; |
| `root_folder_path` | Default Root Folder Path to use when adding new shows.<br>Use the `sonarr_folder` [Sonarr Details](../metadata/details/arr.md#sonarr-definition-settings) in the collection definition to set the Root Folder per collection. | N/A | &#9989; |
| `monitor` | Default Monitor to use when adding new shows.<br>Use the `sonarr_monitor` [Sonarr Details](../metadata/details/arr.md#sonarr-definition-settings) in the collection definition to set the Monitor value per collection.<br>**Values:** <table class="clearTable"><tr><td>`all`</td><td>All episodes except specials</td></tr><tr><td>`future`</td><td>Episodes that have not aired yet</td></tr><tr><td>`missing`</td><td>Episodes that do not have files or have not aired yet</td></tr><tr><td>`existing`</td><td>Episodes that have files or have not aired yet</td></tr><tr><td>`pilot`</td><td>The first episode, all others will be ignored</td></tr><tr><td>`first`</td><td>All episodes of the first season, all others will be ignored</td></tr><tr><td>`latest`</td><td>All episodes of the latest season and future seasons</td></tr><tr><td>`none`</td><td>No episodes</td></tr></table> | `all` | &#10060; |
| `quality_profile` | Default Quality Profile to use when adding new shows.<br>Use the `sonarr_quality` [Sonarr Details](../metadata/details/arr.md#sonarr-definition-settings) in the collection definition to set the Quality Profile per collection. | N/A | &#9989; |

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

@ -9,6 +9,7 @@ All the following attributes can override the global/library [Radarr](../../conf
| `radarr_add_missing` | **Description:** Override Radarr `add_missing` attribute<br>**Values:** `true` or `false` |
| `radarr_add_existing` | **Description:** Override Radarr `add_existing` attribute<br>**Values:** `true` or `false` |
| `radarr_upgrade_existing` | **Description:** Override Radarr `upgrade_existing` attribute<br>**Values:** `true` or `false` |
| `radarr_ignore_cache` | **Description:** Override Radarr `ignore_cache` attribute<br>**Values:** `true` or `false` |
| `radarr_folder` | **Description:** Override Radarr `root_folder_path` attribute<br>**Values:** Folder Path |
| `radarr_monitor` | **Description:** Override Radarr `monitor` attribute<br>**Values:** `movie`, `collection`, or `none` |
| `radarr_availability` | **Description:** Override Radarr `availability` attribute<br>**Values:** `announced`, `cinemas`, `released`, `db` |
@ -28,6 +29,7 @@ All the following attributes can override the global/library [Sonarr](../../conf
| `sonarr_add_missing` | **Description:** Override Sonarr `add_missing` attribute<br>**Values:** `true` or `false` |
| `sonarr_add_existing` | **Description:** Override Sonarr `add_existing` attribute<br>**Values:** `true` or `false` |
| `sonarr_upgrade_existing` | **Description:** Override Sonarr `upgrade_existing` attribute<br>**Values:** `true` or `false` |
| `sonarr_ignore_cache` | **Description:** Override Sonarr `ignore_cache` attribute<br>**Values:** `true` or `false` |
| `sonarr_folder` | **Description:** Override Sonarr `root_folder_path` attribute<br>**Values:** Folder Path |
| `sonarr_monitor` | **Description:** Override Sonarr `monitor` attribute<br>**Values:** `all`, `future`, `missing`, `existing`, `pilot`, `first`, `latest`, `none` |
| `sonarr_quality` | **Description:** Override Sonarr `quality_profile` attribute<br>**Values:** Sonarr Quality Profile |

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

@ -57,11 +57,11 @@ item_details = ["non_item_remove_label", "item_label", "item_genre", "item_editi
none_details = ["label.sync", "item_label.sync", "item_genre.sync", "radarr_taglist", "sonarr_taglist", "item_edition"]
radarr_details = [
"radarr_add_missing", "radarr_add_existing", "radarr_upgrade_existing", "radarr_folder", "radarr_monitor",
"radarr_search", "radarr_availability", "radarr_quality", "radarr_tag", "item_radarr_tag"
"radarr_search", "radarr_availability", "radarr_quality", "radarr_tag", "item_radarr_tag", "radarr_ignore_cache"
]
sonarr_details = [
"sonarr_add_missing", "sonarr_add_existing", "sonarr_upgrade_existing", "sonarr_folder", "sonarr_monitor", "sonarr_language",
"sonarr_series", "sonarr_quality", "sonarr_season", "sonarr_search", "sonarr_cutoff_search", "sonarr_tag", "item_sonarr_tag"
"sonarr_series", "sonarr_quality", "sonarr_season", "sonarr_search", "sonarr_cutoff_search", "sonarr_tag", "item_sonarr_tag", "sonarr_ignore_cache"
]
album_details = ["non_item_remove_label", "item_label", "item_album_sorting"]
sub_filters = [
@ -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:
@ -1069,7 +1076,7 @@ class CollectionBuilder:
self.item_details[method_name] = str(method_data).lower()
def _radarr(self, method_name, method_data):
if method_name in ["radarr_add_missing", "radarr_add_existing", "radarr_upgrade_existing", "radarr_search", "radarr_monitor"]:
if method_name in ["radarr_add_missing", "radarr_add_existing", "radarr_upgrade_existing", "radarr_search", "radarr_monitor", "radarr_ignore_cache"]:
self.radarr_details[method_name[7:]] = util.parse(self.Type, method_name, method_data, datatype="bool")
elif method_name == "radarr_folder":
self.radarr_details["folder"] = method_data
@ -1088,7 +1095,7 @@ class CollectionBuilder:
self.builders.append((method_name, True))
def _sonarr(self, method_name, method_data):
if method_name in ["sonarr_add_missing", "sonarr_add_existing", "sonarr_upgrade_existing", "sonarr_season", "sonarr_search", "sonarr_cutoff_search"]:
if method_name in ["sonarr_add_missing", "sonarr_add_existing", "sonarr_upgrade_existing", "sonarr_season", "sonarr_search", "sonarr_cutoff_search", "sonarr_ignore_cache"]:
self.sonarr_details[method_name[7:]] = util.parse(self.Type, method_name, method_data, datatype="bool")
elif method_name in ["sonarr_folder", "sonarr_quality", "sonarr_language"]:
self.sonarr_details[method_name[7:]] = method_data

@ -640,6 +640,7 @@ class ConfigFile:
"add_missing": check_for_attribute(self.data, "add_missing", parent="radarr", var_type="bool", default=False),
"add_existing": check_for_attribute(self.data, "add_existing", parent="radarr", var_type="bool", default=False),
"upgrade_existing": check_for_attribute(self.data, "upgrade_existing", parent="radarr", var_type="bool", default=False),
"ignore_cache": check_for_attribute(self.data, "ignore_cache", parent="radarr", var_type="bool", default=False),
"root_folder_path": check_for_attribute(self.data, "root_folder_path", parent="radarr", default_is_none=True),
"monitor": check_for_attribute(self.data, "monitor", parent="radarr", var_type="bool", default=True),
"availability": check_for_attribute(self.data, "availability", parent="radarr", test_list=radarr.availability_descriptions, default="announced"),
@ -655,6 +656,7 @@ class ConfigFile:
"add_missing": check_for_attribute(self.data, "add_missing", parent="sonarr", var_type="bool", default=False),
"add_existing": check_for_attribute(self.data, "add_existing", parent="sonarr", var_type="bool", default=False),
"upgrade_existing": check_for_attribute(self.data, "upgrade_existing", parent="sonarr", var_type="bool", default=False),
"ignore_cache": check_for_attribute(self.data, "ignore_cache", parent="sonarr", var_type="bool", default=False),
"root_folder_path": check_for_attribute(self.data, "root_folder_path", parent="sonarr", default_is_none=True),
"monitor": check_for_attribute(self.data, "monitor", parent="sonarr", test_list=sonarr.monitor_descriptions, default="all"),
"quality_profile": check_for_attribute(self.data, "quality_profile", parent="sonarr", default_is_none=True),
@ -923,6 +925,7 @@ class ConfigFile:
"add_missing": check_for_attribute(lib, "add_missing", parent="radarr", var_type="bool", default=self.general["radarr"]["add_missing"], save=False),
"add_existing": check_for_attribute(lib, "add_existing", parent="radarr", var_type="bool", default=self.general["radarr"]["add_existing"], save=False),
"upgrade_existing": check_for_attribute(lib, "upgrade_existing", parent="radarr", var_type="bool", default=self.general["radarr"]["upgrade_existing"], save=False),
"ignore_cache": check_for_attribute(lib, "ignore_cache", parent="radarr", var_type="bool", default=self.general["radarr"]["ignore_cache"], save=False),
"root_folder_path": check_for_attribute(lib, "root_folder_path", parent="radarr", default=self.general["radarr"]["root_folder_path"], req_default=True, save=False),
"monitor": check_for_attribute(lib, "monitor", parent="radarr", var_type="bool", default=self.general["radarr"]["monitor"], save=False),
"availability": check_for_attribute(lib, "availability", parent="radarr", test_list=radarr.availability_descriptions, default=self.general["radarr"]["availability"], save=False),
@ -951,6 +954,7 @@ class ConfigFile:
"add_missing": check_for_attribute(lib, "add_missing", parent="sonarr", var_type="bool", default=self.general["sonarr"]["add_missing"], save=False),
"add_existing": check_for_attribute(lib, "add_existing", parent="sonarr", var_type="bool", default=self.general["sonarr"]["add_existing"], save=False),
"upgrade_existing": check_for_attribute(lib, "upgrade_existing", parent="sonarr", var_type="bool", default=self.general["sonarr"]["upgrade_existing"], save=False),
"ignore_cache": check_for_attribute(lib, "ignore_cache", parent="sonarr", var_type="bool", default=self.general["sonarr"]["ignore_cache"], save=False),
"root_folder_path": check_for_attribute(lib, "root_folder_path", parent="sonarr", default=self.general["sonarr"]["root_folder_path"], req_default=True, save=False),
"monitor": check_for_attribute(lib, "monitor", parent="sonarr", test_list=sonarr.monitor_descriptions, default=self.general["sonarr"]["monitor"], save=False),
"quality_profile": check_for_attribute(lib, "quality_profile", parent="sonarr", default=self.general["sonarr"]["quality_profile"], req_default=True, save=False),

@ -167,12 +167,10 @@ class Library(ABC):
if self.config.Cache:
_, image_compare, _ = self.config.Cache.query_image_map(item.ratingKey, self.image_table_name)
if not image_compare or str(poster.compare) != str(image_compare):
if hasattr(item, "labels"):
test = [la.tag for la in self.item_labels(item)]
if overlay and "Overlay" in test:
if overlay:
self.reload(item, force=True)
if overlay and "Overlay" in [la.tag for la in self.item_labels(item)]:
item.removeLabel("Overlay")
if isinstance(item._edits, dict):
item.saveEdits()
self._upload_image(item, poster)
poster_uploaded = True
logger.info(f"Detail: {poster.attribute} updated {poster.message}")

@ -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:
@ -1210,7 +1218,7 @@ class MetadataFile(DataFile):
nonlocal updated
if updated:
try:
current_item.saveEdits()
#current_item.saveEdits()
logger.info(f"{description} Details Update Successful")
except BadRequest:
logger.error(f"{description} Details Update Failed")
@ -1256,7 +1264,7 @@ class MetadataFile(DataFile):
summary = tmdb_item.overview
genres = tmdb_item.genres
item.batchEdits()
#item.batchEdits()
if title:
add_edit("title", item, meta, methods, value=title)
add_edit("sort_title", item, meta, methods, key="titleSort")
@ -1279,7 +1287,7 @@ class MetadataFile(DataFile):
if self.library.type in util.advance_tags_to_edit:
advance_edits = {}
prefs = [p.id for p in item.preferences()]
prefs = None
for advance_edit in util.advance_tags_to_edit[self.library.type]:
if advance_edit in methods:
if advance_edit in ["metadata_language", "use_original_title"] and self.library.agent not in plex.new_plex_agents:
@ -1287,6 +1295,8 @@ class MetadataFile(DataFile):
elif meta[methods[advance_edit]]:
ad_key, options = plex.item_advance_keys[f"item_{advance_edit}"]
method_data = str(meta[methods[advance_edit]]).lower()
if prefs is None:
prefs = [p.id for p in item.preferences()]
if method_data not in options:
logger.error(f"Metadata Error: {meta[methods[advance_edit]]} {advance_edit} attribute invalid")
elif ad_key in prefs and getattr(item, ad_key) != options[method_data]:

@ -79,7 +79,7 @@ class Overlays:
poster = None
if self.config.Cache:
image, image_compare, overlay_compare = self.config.Cache.query_image_map(item.ratingKey, f"{self.library.image_table_name}_overlays")
self.library.reload(item)
self.library.reload(item, force=True)
overlay_compare = [] if overlay_compare is None else util.get_list(overlay_compare, split="|")
has_overlay = any([item_tag.tag.lower() == "overlay" for item_tag in self.library.item_labels(item)])

@ -611,7 +611,7 @@ class Plex(Library):
return self.config.TMDb.get_episode(tmdb_id, item.seasonNumber, item.episodeNumber).still_url
def item_posters(self, item, providers=None):
if not providers:
if providers is None:
providers = ["plex", "tmdb"]
image_url = None
for provider in providers:
@ -1139,9 +1139,17 @@ class Plex(Library):
if image:
logger.info(f"{text} | Reset from {location}")
if poster:
try:
self.upload_poster(item, image, url=image_url)
except BadRequest as e:
logger.stacktrace()
logger.error(f"Plex Error: {e}")
else:
try:
self.upload_background(item, image, url=image_url)
except BadRequest as e:
logger.stacktrace()
logger.error(f"Plex Error: {e}")
if poster and "Overlay" in [la.tag for la in self.item_labels(item)]:
logger.info(self.edit_tags("label", item, remove_tags="Overlay", do_print=False))
else:
@ -1323,7 +1331,7 @@ class Plex(Library):
if is_top_level and self.asset_folders and self.dimensional_asset_rename and (not poster or not background):
for file in util.glob_filter(os.path.join(item_asset_directory, "*.*")):
if file.lower().endswith((".png", ".jpg", ".jpeg", "webp")) and re.match(r"s\d+e\d+|season\d+", file.lower()):
if file.lower().endswith((".png", ".jpg", ".jpeg", "webp")) and not re.match(r"s\d+e\d+|season\d+", file.lower()):
try:
image = Image.open(file)
_w, _h = image.size

@ -38,6 +38,7 @@ class Radarr:
self.search = params["search"]
self.radarr_path = params["radarr_path"] if params["radarr_path"] and params["plex_path"] else ""
self.plex_path = params["plex_path"] if params["radarr_path"] and params["plex_path"] else ""
self.ignore_cache = params["ignore_cache"]
def add_tmdb(self, tmdb_ids, **options):
_ids = []
@ -55,6 +56,7 @@ class Radarr:
logger.debug(tmdb_id)
logger.trace("")
upgrade_existing = options["upgrade_existing"] if "upgrade_existing" in options else self.upgrade_existing
ignore_cache = options["ignore_cache"] if "ignore_cache" in options else self.ignore_cache
folder = options["folder"] if "folder" in options else self.root_folder_path
monitor = options["monitor"] if "monitor" in options else self.monitor
availability = availability_translation[options["availability"] if "availability" in options else self.availability]
@ -62,6 +64,7 @@ class Radarr:
tags = options["tag"] if "tag" in options else self.tag
search = options["search"] if "search" in options else self.search
logger.trace(f"Upgrade Existing: {upgrade_existing}")
logger.trace(f"Ignore Cache: {ignore_cache}")
logger.trace(f"Folder: {folder}")
logger.trace(f"Monitor: {monitor}")
logger.trace(f"Availability: {availability}")
@ -96,7 +99,7 @@ class Radarr:
tmdb_id = item[0] if isinstance(item, tuple) else item
logger.ghost(f"Loading TMDb ID {i}/{len(tmdb_ids)} ({tmdb_id})")
try:
if self.config.Cache:
if self.config.Cache and not ignore_cache:
_id = self.config.Cache.query_radarr_adds(tmdb_id, self.library.original_mapping_name)
if _id:
skipped.append(item)

@ -58,6 +58,7 @@ class Sonarr:
self.cutoff_search = params["cutoff_search"]
self.sonarr_path = params["sonarr_path"] if params["sonarr_path"] and params["plex_path"] else ""
self.plex_path = params["plex_path"] if params["sonarr_path"] and params["plex_path"] else ""
self.ignore_cache = params["ignore_cache"]
def add_tvdb(self, tvdb_ids, **options):
_ids = []
@ -74,6 +75,7 @@ class Sonarr:
for tvdb_id in _paths:
logger.debug(tvdb_id)
upgrade_existing = options["upgrade_existing"] if "upgrade_existing" in options else self.upgrade_existing
ignore_cache = options["ignore_cache"] if "ignore_cache" in options else self.ignore_cache
folder = options["folder"] if "folder" in options else self.root_folder_path
monitor = monitor_translation[options["monitor"] if "monitor" in options else self.monitor]
quality_profile = options["quality"] if "quality" in options else self.quality_profile
@ -85,6 +87,7 @@ class Sonarr:
search = options["search"] if "search" in options else self.search
cutoff_search = options["cutoff_search"] if "cutoff_search" in options else self.cutoff_search
logger.trace(f"Upgrade Existing: {upgrade_existing}")
logger.trace(f"Ignore Cache: {ignore_cache}")
logger.trace(f"Folder: {folder}")
logger.trace(f"Monitor: {monitor}")
logger.trace(f"Quality Profile: {quality_profile}")
@ -120,7 +123,7 @@ class Sonarr:
tvdb_id = item[0] if isinstance(item, tuple) else item
logger.ghost(f"Loading TVDb ID {i}/{len(tvdb_ids)} ({tvdb_id})")
try:
if self.config.Cache:
if self.config.Cache and not ignore_cache:
_id = self.config.Cache.query_sonarr_adds(tvdb_id, self.library.original_mapping_name)
if _id:
skipped.append(item)

@ -254,7 +254,7 @@ class Trakt:
except Failed:
raise Failed(f"Trakt Error: List {data} not found")
def _parse(self, items, typeless=False, item_type=None, trakt_ids=False):
def _parse(self, items, typeless=False, item_type=None, trakt_ids=False, ignore_other=False):
ids = []
for item in items:
if typeless:
@ -268,6 +268,8 @@ class Trakt:
current_type = item["type"]
else:
continue
if current_type in ["person", "list"] and ignore_other:
continue
id_type, id_display = id_types[current_type]
if id_type in data["ids"] and data["ids"][id_type]:
final_id = data["ids"][id_type]
@ -373,7 +375,7 @@ class Trakt:
def build_user_url(self, user, name):
return f"{base_url.replace('api.', '')}/users/{user}/lists/{name}"
def _list(self, data, urlparse=True, trakt_ids=False, fail=True):
def _list(self, data, urlparse=True, trakt_ids=False, fail=True, ignore_other=False):
try:
url = requests.utils.urlparse(data).path if urlparse else f"/users/me/lists/{data}"
items = self._request(f"{url}/items")
@ -384,9 +386,9 @@ class Trakt:
raise Failed(f"Trakt Error: List {data} is empty")
else:
return []
return self._parse(items, trakt_ids=trakt_ids)
return self._parse(items, trakt_ids=trakt_ids, ignore_other=ignore_other)
def _userlist(self, list_type, user, is_movie, sort_by=None):
def _userlist(self, list_type, user, is_movie, sort_by=None, ignore_other=False):
try:
url_end = "movies" if is_movie else "shows"
if sort_by:
@ -396,7 +398,7 @@ class Trakt:
raise Failed(f"Trakt Error: User {user} not found")
if len(items) == 0:
raise Failed(f"Trakt Error: {user}'s {list_type.capitalize()} is empty")
return self._parse(items, item_type="movie" if is_movie else "show")
return self._parse(items, item_type="movie" if is_movie else "show", ignore_other=ignore_other)
def _recommendations(self, limit, is_movie):
media_type = "Movie" if is_movie else "Show"
@ -408,10 +410,10 @@ class Trakt:
raise Failed(f"Trakt Error: no {media_type} Recommendations were found")
return self._parse(items, typeless=True, item_type="movie" if is_movie else "show")
def _charts(self, chart_type, is_movie, params, time_period=None):
def _charts(self, chart_type, is_movie, params, time_period=None, ignore_other=False):
chart_url = f"{chart_type}/{time_period}" if time_period else chart_type
items = self._request(f"/{'movies' if is_movie else 'shows'}/{chart_url}", params=params)
return self._parse(items, typeless=chart_type == "popular", item_type="movie" if is_movie else "show")
return self._parse(items, typeless=chart_type == "popular", item_type="movie" if is_movie else "show", ignore_other=ignore_other)
def get_people(self, data):
return {str(i[0][0]): i[0][1] for i in self._list(data) if i[1] == "tmdb_person"}
@ -491,7 +493,7 @@ class Trakt:
media_type = "Movie" if is_movie else "Show"
if method == "trakt_list":
logger.info(f"Processing {pretty}: {data}")
return self._list(data)
return self._list(data, ignore_other=True)
elif method == "trakt_recommendations":
logger.info(f"Processing {pretty}: {data} {media_type}{'' if data == 1 else 's'}")
return self._recommendations(data, is_movie)
@ -504,10 +506,10 @@ class Trakt:
logger.info(f"{attr:>22}: {','.join(data[attr]) if isinstance(data[attr], list) else data[attr]}")
values = [status_translation[v] for v in data[attr]] if attr == "status" else data[attr]
params[attr] = ",".join(values) if isinstance(values, list) else values
return self._charts(data["chart"], is_movie, params, time_period=data["time_period"])
return self._charts(data["chart"], is_movie, params, time_period=data["time_period"], ignore_other=True)
elif method == "trakt_userlist":
logger.info(f"Processing {pretty} {media_type}s from {data['user']}'s {data['userlist'].capitalize()}")
return self._userlist(data["userlist"], data["user"], is_movie, sort_by=data["sort_by"])
return self._userlist(data["userlist"], data["user"], is_movie, sort_by=data["sort_by"], ignore_other=True)
elif method == "trakt_boxoffice":
logger.info(f"Processing {pretty}: {data} {media_type}{'' if data == 1 else 's'}")
return self._charts("boxoffice", is_movie, {"limit": data})

Loading…
Cancel
Save