[13] small updates

pull/1663/head
meisnate12 1 year ago
parent 10dc559da8
commit 67540f993d

@ -1 +1 @@
1.19.1-develop12
1.19.1-develop13

@ -2,11 +2,15 @@
IMPORTANT: The variables in this table are only valid in the context of the [`PMM default metadata files`](guide).
There are some `template_variables` that all the PMM Defaults except [`franchise`](movie/franchise) and [`collectionless`](both/collectionless) can use to manipulate the file from the default settings which are provided.
There are some `template_variables` that all the PMM Defaults except [`franchise`](movie/franchise) and [`collectionless`](both/collectionless) can use to manipulate the file from the default settings which are provided. This page is not an exhaustive list of all such template variables.
Note that the `template_variables:` section only needs to be used if you do want to actually change how the defaults work. Any value not specified is its default value if it has one if not it's just ignored.
The variables listed on this page are common to all default collection files [aside from `franchise` and `collectionless`]; each individual collection file *may* have other template variables available. Those will be listed on the wiki page for each individual default collection file.
Below are the available variables which can be used to customize the file.
Some of these template variables may have default values depending on the specific collection file. Those default values will also be listed on the individual collection file page.
Note that the `template_variables:` section only needs to be used if you do want to actually change how the defaults work. Any value not specified will use its default value if it has one if not it's just ignored.
Below are the common variables which can be used to customize the file.
| Variable | Description & Values |
|:-----------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|

@ -70,7 +70,6 @@ This is the default PMM collection ordering:
| `network` | `050` |
| `genre` | `060` |
| `studio` | `070` |
| `studio_anime` | `070` |
| `country` | `080` |
| `region` | `081` |
| `continent` | `082` |

@ -2,11 +2,15 @@
IMPORTANT: The variables in this table are only valid in the context of the [`PMM default metadata files`](guide).
There are some `template_variables` that all the PMM Defaults except `franchise` can use to manipulate the file from the default settings which are provided.
There are some `template_variables` that all the PMM Defaults except `franchise` can use to manipulate the file from the default settings which are provided. This page is not an exhaustive list of all such template variables.
Note that the `template_variables:` section only needs to be used if you do want to actually change how the defaults work. Any value not specified is its default value if it has one if not it's just ignored.
The variables listed on this page are common to all default overlay files [aside from `franchise`]; each individual overlay *may* have other template variables available. Those will be listed on the wiki page for each individual default overlay file.
Below are the available variables which can be used to customize the file.
Some of these template variables may have default values depending on the specific overlay. Those default values will also be listed on the individual overlay page.
Note that the `template_variables:` section only needs to be used if you do want to actually change how the defaults work. Any value not specified will use its default value if it has one if not it's just ignored.
Below are the common variables which can be used to customize the file.
| Variable | Description & Values |
|:---------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
@ -23,13 +27,13 @@ Below are the available variables which can be used to customize the file.
| `horizontal_align` | **Description:** Controls the Horizontal Alignment of the overlay.<br>**Values:** `left`, `center`, or `right` |
| `vertical_offset` | **Description:** Controls the Vertical Offset of this overlay. Can be a %.<br>**Values:** Number 0 or greater or 0%-100% |
| `vertical_align` | **Description:** Controls the Vertical Alignment of the overlay.<br>**Values:** `top`, `center`, or `bottom` |
| `back_color` | **Description:** Controls the Backdrop Color for the Text Overlay.<br>**Values:** Color Hex Code in format `#RGB`, `#RGBA`, `#RRGGBB` or `#RRGGBBAA`<br>`AA` is transparency; 00 [transparent] to FF [opaque]|
| `back_color` | **Description:** Controls the Backdrop Color for the Text Overlay.<br>**Values:** Color Hex Code in format `#RGB`, `#RGBA`, `#RRGGBB` or `#RRGGBBAA`<br>`AA` is transparency; 00 [transparent] to FF [opaque] |
| `back_width` | **Description:** Controls the Backdrop Width for the Text Overlay. If `back_width` is not specified the Backdrop Sizes to the text<br>**Values:** Any number greater than 0 |
| `back_height` | **Description:** Controls the Backdrop Height for the Text Overlay. If `back_height` is not specified the Backdrop Sizes to the text<br>**Values:** Any number greater than 0 |
| `back_align` | **Description:** Controls the Alignment for the Text Overlay inside the backdrop. If `back_align` is not specified the Backdrop Centers the text.<br>**Values:** `left`, `right`, `center`, `top`, or `bottom` |
| `back_padding` | **Description:** Controls the Backdrop Padding for the Text Overlay.<br>**Values:** Any number greater than 0 |
| `back_radius` | **Description:** Controls the Backdrop Radius for the Text Overlay.<br>**Values:** Any number greater than 0 |
| `back_line_color` | **Description:** Controls the Backdrop Line Color for the Text Overlay.<br>**Values:** Color Hex Code in format `#RGB`, `#RGBA`, `#RRGGBB` or `#RRGGBBAA``AA` is transparency; 00 [transparent] to FF [opaque]|
| `back_line_color` | **Description:** Controls the Backdrop Line Color for the Text Overlay.<br>**Values:** Color Hex Code in format `#RGB`, `#RGBA`, `#RRGGBB` or `#RRGGBBAA``AA` is transparency; 00 [transparent] to FF [opaque] |
| `back_line_width` | **Description:** Controls the Backdrop Line Width for the Text Overlay.<br>**Values:** Any number greater than 0 |
1. Each default overlay has a `key` that when calling to effect a specific collection you must replace `<<key>>` with when calling.

@ -670,19 +670,6 @@ class CollectionBuilder:
logger.debug(f"Value: {data[methods['delete_not_scheduled']]}")
self.details["delete_not_scheduled"] = util.parse(self.Type, "delete_not_scheduled", self.data, datatype="bool", methods=methods, default=False)
if "delete_collections_named" in methods and not self.overlay and not self.playlist:
logger.debug("")
logger.debug("Validating Method: delete_collections_named")
logger.debug(f"Value: {data[methods['delete_collections_named']]}")
for del_col in util.parse(self.Type, "delete_collections_named", self.data, datatype="strlist", methods=methods):
try:
del_obj = self.library.get_collection(del_col, force_search=True)
self.library.delete(del_obj)
logger.info(f"Collection: {del_obj.title} deleted")
except Failed as e:
if str(e).startswith("Plex Error: Failed to delete"):
logger.error(e)
if "schedule" in methods and not self.config.requested_collections and not self.overlay:
logger.debug("")
logger.debug("Validating Method: schedule")
@ -712,6 +699,19 @@ class CollectionBuilder:
suffix = f" and could not be found to delete"
raise NotScheduled(f"{err}\n\n{self.Type} {self.name} not scheduled to run{suffix}")
if "delete_collections_named" in methods and not self.overlay and not self.playlist:
logger.debug("")
logger.debug("Validating Method: delete_collections_named")
logger.debug(f"Value: {data[methods['delete_collections_named']]}")
for del_col in util.parse(self.Type, "delete_collections_named", self.data, datatype="strlist", methods=methods):
try:
del_obj = self.library.get_collection(del_col, force_search=True)
self.library.delete(del_obj)
logger.info(f"Collection: {del_obj.title} deleted")
except Failed as e:
if str(e).startswith("Plex Error: Failed to delete"):
logger.error(e)
self.collectionless = "plex_collectionless" in methods and not self.playlist and not self.overlay
self.validate_builders = True
@ -2540,7 +2540,7 @@ class CollectionBuilder:
if self.details["changes_webhooks"]:
self.notification_removals.append(util.item_set(item, self.library.get_id_from_maps(item.ratingKey)))
if self.playlist and items_removed:
self.obj.reload()
self.library._reload(self.obj)
self.obj.removeItems(items_removed)
if self.do_report and items_removed:
self.library.add_removed(self.name, [(i.title, self.library.get_id_from_maps(i.ratingKey)) for i in items_removed], self.library.is_movie)
@ -2967,7 +2967,7 @@ class CollectionBuilder:
logger.error("Details: Failed to Update Please delete the collection and run again")
logger.info("")
else:
self.obj.reload()
self.library._reload(self.obj)
#self.obj.batchEdits()
batch_display = "Collection Metadata Edits"
if summary and str(summary[1]) != str(self.obj.summary):
@ -3160,7 +3160,7 @@ class CollectionBuilder:
logger.separator(f"Syncing {self.name} {self.Type} to Trakt List {self.sync_to_trakt_list}", space=False, border=False)
logger.info("")
if self.obj:
self.obj.reload()
self.library._reload(self.obj)
self.load_collection_items()
current_ids = []
for item in self.items:
@ -3222,7 +3222,7 @@ class CollectionBuilder:
def send_notifications(self, playlist=False):
if self.obj and self.details["changes_webhooks"] and \
(self.created or len(self.notification_additions) > 0 or len(self.notification_removals) > 0):
self.obj.reload()
self.library._reload(self.obj)
try:
self.library.Webhooks.collection_hooks(
self.details["changes_webhooks"],

@ -723,6 +723,15 @@ class Plex(Library):
raise Failed("Overlay Error: No Poster found to reset")
return image_url
def _reload(self, item):
item.reload(checkFiles=False, includeAllConcerts=False, includeBandwidths=False, includeChapters=False,
includeChildren=False, includeConcerts=False, includeExternalMedia=False, includeExtras=False,
includeFields=False, includeGeolocation=False, includeLoudnessRamps=False, includeMarkers=False,
includeOnDeck=False, includePopularLeaves=False, includeRelated=False, includeRelatedCount=0,
includeReviews=False, includeStations=False)
item._autoReload = False
return item
@retry(stop_max_attempt_number=6, wait_fixed=10000, retry_on_exception=util.retry_if_not_plex)
def reload(self, item, force=False):
is_full = False
@ -730,12 +739,7 @@ class Plex(Library):
item, is_full = self.cached_items[item.ratingKey]
try:
if not is_full or force:
item.reload(checkFiles=False, includeAllConcerts=False, includeBandwidths=False, includeChapters=False,
includeChildren=False, includeConcerts=False, includeExternalMedia=False, includeExtras=False,
includeFields=False, includeGeolocation=False, includeLoudnessRamps=False, includeMarkers=False,
includeOnDeck=False, includePopularLeaves=False, includeRelated=False, includeRelatedCount=0,
includeReviews=False, includeStations=False)
item._autoReload = False
self._reload(item)
self.cached_items[item.ratingKey] = (item, True)
except (BadRequest, NotFound) as e:
logger.stacktrace()

@ -3,9 +3,9 @@ GitPython==3.1.37
lxml==4.9.3
num2words==0.5.12
pathvalidate==3.2.0
pillow==10.0.1
pillow==10.1.0
PlexAPI==4.15.4
psutil==5.9.5
psutil==5.9.6
python-dotenv==1.0.0
requests==2.31.0
retrying==1.3.4

Loading…
Cancel
Save