From 9277134538fb0e2661fc41bc31a0a6b503ed45c8 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Fri, 12 Nov 2021 11:49:04 -0500 Subject: [PATCH] final update cleanup --- README.md | 7 ++++--- config/config.yml.template | 18 +++++++++--------- modules/builder.py | 10 +++++----- modules/config.py | 11 ++++++----- modules/library.py | 2 +- 5 files changed, 25 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 986ea12d..ad5753b5 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ # Plex Meta Manager [![GitHub release (latest by date)](https://img.shields.io/github/v/release/meisnate12/Plex-Meta-Manager?style=plastic)](https://github.com/meisnate12/Plex-Meta-Manager/releases) -[![GitHub commits since latest release (by SemVer)](https://img.shields.io/github/commits-since/meisnate12/plex-meta-manager/latest/develop?label=Number%20of%20Commits%20in%20Develop&style=plastic)](https://github.com/meisnate12/Plex-Meta-Manager/tree/develop) +[![GitHub commits since latest release (by SemVer)](https://img.shields.io/github/commits-since/meisnate12/plex-meta-manager/latest/develop?label=Commits%20in%20Develop&style=plastic)](https://github.com/meisnate12/Plex-Meta-Manager/tree/develop) [![Docker Image Version (latest semver)](https://img.shields.io/docker/v/meisnate12/plex-meta-manager?label=docker&sort=semver&style=plastic)](https://hub.docker.com/r/meisnate12/plex-meta-manager) [![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/meisnate12/plex-meta-manager?style=plastic)](https://hub.docker.com/r/meisnate12/plex-meta-manager) +[![Docker Pulls](https://img.shields.io/docker/pulls/meisnate12/plex-meta-manager?style=plastic)](https://hub.docker.com/r/meisnate12/plex-meta-manager) [![Discord](https://img.shields.io/discord/822460010649878528?label=Discord&style=plastic)](https://discord.gg/TsdpsFYqqm) [![Sponsor or Donate](https://img.shields.io/badge/-Sponsor_or_Donate-blueviolet?style=plastic)](https://github.com/sponsors/meisnate12) @@ -11,7 +12,7 @@ The original concept for Plex Meta Manager is [Plex Auto Collections](https://gi The script can update many metadata fields for movies, shows, collections, seasons, and episodes and can act as a backup if your plex DB goes down. It can even update metadata the plex UI can't like Season Names. If the time is put into the metadata configuration file you can have a way to recreate your library and all its metadata changes with the click of a button. -The script is designed to work with most Metadata agents including the new Plex Movie Agent, New Plex TV Agent, [Hama Anime Agent](https://github.com/ZeroQI/Hama.bundle), and [MyAnimeList Anime Agent](https://github.com/Fribb/MyAnimeList.bundle). +The script works with most Metadata agents including the new Plex Movie Agent, New Plex TV Agent, [Hama Anime Agent](https://github.com/ZeroQI/Hama.bundle), and [MyAnimeList Anime Agent](https://github.com/Fribb/MyAnimeList.bundle). ## Getting Started @@ -23,7 +24,7 @@ The script is designed to work with most Metadata agents including the new Plex ## Support -* Before posting on Github about an enhancement, error, or configuration question please visit the [Plex Meta Manager Discord Server](https://discord.gg/TsdpsFYqqm). +* Before posting on GitHub about an enhancement, error, or configuration question please visit the [Plex Meta Manager Discord Server](https://discord.gg/TsdpsFYqqm). * If you're getting an Error or have an Enhancement post in the [Issues](https://github.com/meisnate12/Plex-Meta-Manager/issues). * If you have a configuration question post in the [Discussions](https://github.com/meisnate12/Plex-Meta-Manager/discussions). * To see user submitted Metadata configuration files, and you to even add your own, go to the [Plex Meta Manager Configs](https://github.com/meisnate12/Plex-Meta-Manager-Configs). diff --git a/config/config.yml.template b/config/config.yml.template index ca361ea4..543a0ea8 100644 --- a/config/config.yml.template +++ b/config/config.yml.template @@ -36,7 +36,7 @@ webhooks: # Can be individually specified run_end: collection_creation: collection_addition: - collection_removing: + collection_removal: plex: # Can be individually specified per library as well url: http://192.168.1.12:32400 token: #################### @@ -50,6 +50,13 @@ tmdb: tautulli: # Can be individually specified per library as well url: http://192.168.1.12:8181 apikey: ################################ +omdb: + apikey: ######## +notifiarr: + apikey: #################################### +anidb: # Not required for AniDB builders unless you want mature content + username: ###### + password: ###### radarr: # Can be individually specified per library as well url: http://192.168.1.12:7878 token: ################################ @@ -73,10 +80,6 @@ sonarr: # Can be individually specified tag: search: false cutoff_search: false -omdb: - apikey: ######## -notifiarr: - apikey: #################################### trakt: client_id: ################################################################ client_secret: ################################################################ @@ -96,7 +99,4 @@ mal: access_token: token_type: expires_in: - refresh_token: -anidb: # Optional - username: ###### - password: ###### \ No newline at end of file + refresh_token: \ No newline at end of file diff --git a/modules/builder.py b/modules/builder.py index 4c58cfc0..9995bd97 100644 --- a/modules/builder.py +++ b/modules/builder.py @@ -86,7 +86,7 @@ ignored_details = [ "smart_filter", "smart_label", "smart_url", "run_again", "schedule", "sync_mode", "template", "test", "tmdb_person", "build_collection", "collection_order", "collection_level", "validate_builders", "collection_name" ] -notification_details = ["collection_creation_webhooks", "collection_addition_webhooks", "collection_removing_webhooks"] +notification_details = ["collection_creation_webhooks", "collection_addition_webhooks", "collection_removal_webhooks"] details = ["collection_mode", "collection_order", "collection_level", "collection_minimum", "label"] + boolean_details + string_details + notification_details collectionless_details = ["collection_order", "plex_collectionless", "label", "label_sync_mode", "test"] + \ poster_details + background_details + summary_details + string_details @@ -179,7 +179,7 @@ class CollectionBuilder: "delete_below_minimum": self.library.delete_below_minimum, "collection_creation_webhooks": self.library.collection_creation_webhooks, "collection_addition_webhooks": self.library.collection_addition_webhooks, - "collection_removing_webhooks": self.library.collection_removing_webhooks, + "collection_removal_webhooks": self.library.collection_removal_webhooks, } self.item_details = {} self.radarr_details = {} @@ -1525,7 +1525,7 @@ class CollectionBuilder: self.library.reload(item) logger.info(f"{self.name} Collection | - | {self.item_title(item)}") self.library.alter_collection(item, self.name, smart_label_collection=self.smart_label_collection, add=False) - if self.details["collection_removing_webhooks"]: + if self.details["collection_removal_webhooks"]: if self.library.is_movie and item.ratingKey in self.library.movie_rating_key_map: remove_id = self.library.movie_rating_key_map[item.ratingKey] elif self.library.is_show and item.ratingKey in self.library.show_rating_key_map: @@ -2045,11 +2045,11 @@ class CollectionBuilder: if self.obj and ( (self.details["collection_creation_webhooks"] and self.created) or (self.details["collection_addition_webhooks"] and len(self.notification_additions) > 0) or - (self.details["collection_removing_webhooks"] and len(self.notification_removals) > 0) + (self.details["collection_removal_webhooks"] and len(self.notification_removals) > 0) ): self.obj.reload() self.library.Webhooks.collection_hooks( - self.details["collection_creation_webhooks"] + self.details["collection_addition_webhooks"] + self.details["collection_removing_webhooks"], + self.details["collection_creation_webhooks"] + self.details["collection_addition_webhooks"] + self.details["collection_removal_webhooks"], self.obj, created=self.created, additions=self.notification_additions, diff --git a/modules/config.py b/modules/config.py index 242e1216..2407501e 100644 --- a/modules/config.py +++ b/modules/config.py @@ -85,16 +85,17 @@ class Config: replace_attr(new_config["libraries"][library], "save_missing", "plex") if "libraries" in new_config: new_config["libraries"] = new_config.pop("libraries") if "settings" in new_config: new_config["settings"] = new_config.pop("settings") + if "webhooks" in new_config: new_config["webhooks"] = new_config.pop("settings") if "plex" in new_config: new_config["plex"] = new_config.pop("plex") if "tmdb" in new_config: new_config["tmdb"] = new_config.pop("tmdb") if "tautulli" in new_config: new_config["tautulli"] = new_config.pop("tautulli") - if "radarr" in new_config: new_config["radarr"] = new_config.pop("radarr") - if "sonarr" in new_config: new_config["sonarr"] = new_config.pop("sonarr") if "omdb" in new_config: new_config["omdb"] = new_config.pop("omdb") if "notifiarr" in new_config: new_config["notifiarr"] = new_config.pop("notifiarr") + if "anidb" in new_config: new_config["anidb"] = new_config.pop("anidb") + if "radarr" in new_config: new_config["radarr"] = new_config.pop("radarr") + if "sonarr" in new_config: new_config["sonarr"] = new_config.pop("sonarr") if "trakt" in new_config: new_config["trakt"] = new_config.pop("trakt") if "mal" in new_config: new_config["mal"] = new_config.pop("mal") - if "anidb" in new_config: new_config["anidb"] = new_config.pop("anidb") yaml.round_trip_dump(new_config, open(self.config_path, "w", encoding="utf-8"), indent=None, block_seq_indent=2) self.data = new_config except yaml.scanner.ScannerError as e: @@ -200,7 +201,7 @@ class Config: "run_end": check_for_attribute(self.data, "run_end", parent="webhooks", var_type="list", default_is_none=True), "collection_creation": check_for_attribute(self.data, "collection_creation", parent="webhooks", var_type="list", default_is_none=True), "collection_addition": check_for_attribute(self.data, "collection_addition", parent="webhooks", var_type="list", default_is_none=True), - "collection_removing": check_for_attribute(self.data, "collection_removing", parent="webhooks", var_type="list", default_is_none=True), + "collection_removal": check_for_attribute(self.data, "collection_removal", parent="webhooks", var_type="list", default_is_none=True), } if self.general["cache"]: util.separator() @@ -399,7 +400,7 @@ class Config: params["error_webhooks"] = check_for_attribute(lib, "error", parent="webhooks", var_type="list", default=self.webhooks["error"], do_print=False, save=False) params["collection_creation_webhooks"] = check_for_attribute(lib, "collection_creation", parent="webhooks", var_type="list", default=self.webhooks["collection_creation"], do_print=False, save=False) params["collection_addition_webhooks"] = check_for_attribute(lib, "collection_addition", parent="webhooks", var_type="list", default=self.webhooks["collection_addition"], do_print=False, save=False) - params["collection_removing_webhooks"] = check_for_attribute(lib, "collection_removing", parent="webhooks", var_type="list", default=self.webhooks["collection_removing"], do_print=False, save=False) + params["collection_removal_webhooks"] = check_for_attribute(lib, "collection_removal", parent="webhooks", var_type="list", default=self.webhooks["collection_removal"], do_print=False, save=False) params["assets_for_all"] = check_for_attribute(lib, "assets_for_all", parent="settings", var_type="bool", default=self.general["assets_for_all"], do_print=False, save=False) params["mass_genre_update"] = check_for_attribute(lib, "mass_genre_update", test_list=mass_update_options, default_is_none=True, save=False, do_print=False) params["mass_audience_rating_update"] = check_for_attribute(lib, "mass_audience_rating_update", test_list=mass_update_options, default_is_none=True, save=False, do_print=False) diff --git a/modules/library.py b/modules/library.py index ff3b0ed5..8276d42a 100644 --- a/modules/library.py +++ b/modules/library.py @@ -61,7 +61,7 @@ class Library(ABC): self.error_webhooks = params["error_webhooks"] self.collection_creation_webhooks = params["collection_creation_webhooks"] self.collection_addition_webhooks = params["collection_addition_webhooks"] - self.collection_removing_webhooks = params["collection_removing_webhooks"] + self.collection_removal_webhooks = params["collection_removal_webhooks"] self.split_duplicates = params["split_duplicates"] # TODO: Here or just in Plex? self.clean_bundles = params["plex"]["clean_bundles"] # TODO: Here or just in Plex? self.empty_trash = params["plex"]["empty_trash"] # TODO: Here or just in Plex?