From 471bcdfcc03c274a8f009dd6b56fdc06260c7690 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Wed, 3 Jan 2024 16:57:07 -0500 Subject: [PATCH] [78] small fixes --- VERSION | 2 +- docs/config/libraries.md | 2 +- docs/defaults/movie/franchise.md | 99 ++++++--------------- docs/pmm/guides/overview.md | 10 ++- docs/pmm/scripts/image-cleanup.md | 9 ++ docs/pmm/scripts/overlay-reset.md | 140 ++---------------------------- docs/pmm/scripts/overview.md | 4 +- modules/builder.py | 12 +-- modules/config.py | 12 +-- 9 files changed, 64 insertions(+), 226 deletions(-) diff --git a/VERSION b/VERSION index bbcce947..1b0fed12 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.19.1-develop77 +1.19.1-develop78 diff --git a/docs/config/libraries.md b/docs/config/libraries.md index 3c1c5871..8d1e6378 100644 --- a/docs/config/libraries.md +++ b/docs/config/libraries.md @@ -372,7 +372,7 @@ The available attributes for each library are as follows: ```yaml libraries: TV Shows: - schedule: weekly(sunday) + schedule_overlays: weekly(sunday) collection_files: - file: config/TV Shows.yml overlay_files: diff --git a/docs/defaults/movie/franchise.md b/docs/defaults/movie/franchise.md index 3f2224ad..c776a0cc 100644 --- a/docs/defaults/movie/franchise.md +++ b/docs/defaults/movie/franchise.md @@ -114,88 +114,39 @@ Note that the `template_variables:` section only needs to be used if you do want **Default `addons`**: ```yaml - addons: - 8091: # Alien - - 135416 # Prometheus - 2806: # American Pie - - 298820 # American Pie (Spin-off) - 87800: # Appleseed - - 371526 # Appleseed XIII - 477208: # DC Super Hero Girls - - 557495 # LEGO DC Super Hero Girls - 86066: # Despicable Me - - 544669 # Minions - 9485: # The Fast and the Furious - - 688042 # Hobbs & Shaw - 86115: # Garfield - - 373918 # Garfield CGI - 91361: # Halloween - - 126209 # Halloween (Rob Zombie Series) - 9818: # Mortal Kombat - - 931431 # Mortal Kombat - 495: # Shaft - - 608103 # Shaft (Reboot) - 1582: # Teenage Mutant Ninja Turtles - - 401562 # Teenage Mutant Ninja Turtles (Remake) - 111751: # Texas Chainsaw Massacre - - 425175 # Texas Chainsaw (Reboot) - 2467: # Tomb Raider - - 621142 # Tomb Raider (Reboot) - 748: # X-Men - - 453993 # The Wolverine + addons: {% + include-markdown "../../../defaults/movie/franchise.yml" + comments=false + preserve-includer-indent=false + start="addons:" + end="title_override:" + %} ``` **Default `title_override`**: ```yaml - title_override: - 10: "Star Wars: Skywalker Saga" - 535313: Godzilla (MonsterVerse) - 535790: Godzilla (Anime) + title_override: {% + include-markdown "../../../defaults/movie/franchise.yml" + comments=false + preserve-includer-indent=false + start="title_override:" + end="template_variables:" + %} ``` - **Default `movie`**: + **Default Template Variables `movie` & `name_mapping`**: - ```yaml - 105995: 336560 # Anaconda: Lake Placid vs. Anaconda - 176097: 14177 # Barbershop: Beauty Shop - 448150: 567604 # Deadpool: Once Upon a Deadpool - 9735: 6466, 222724 # Friday the 13th: Freddy vs. Jason, Crystal Lake Memories: The Complete History of Friday the 13th - 386382: 326359, 460793 # Frozen: Frozen Fever, Olaf's Frozen Adventure - 2980: 43074 # Ghostbusters: Ghostbusters - 374509: 18983 # Godzilla (Showa): Godzilla, King of the Monsters! - 374511: 39256 # Godzilla (Heisei): Godzilla 1985 - 535313: 293167 # Godzilla: Kong: Skull Island - 9743: 11454 # The Hannibal Lecter: Manhunter - 8354: 79218, 717095, 387893 # Ice Age: Ice Age: A Mammoth Christmas, Ice Age Continental Drift: Scrat Got Your Tongue, Ice Age: The Great Egg-Scapade - 70068: 658009, 643413, 450001, 751391, 44249, 182127, 44865 # Ip Man: Ip Man: Kung Fu Master, Ip Man and Four Kings, Master Z: Ip Man Legacy, Young Ip Man: Crisis Time, The Legend Is Born: Ip Man, Ip Man: The Final Fight, The Grandmaster - 328: 630322 # Jurassic Park: Battle at Big Rock - 8580: 38575 # The Karate Kid: The Karate Kid - 14740: 161143, 25472, 270946 # Madagascar: Madly Madagascar, Merry Madagascar, Penguins of Madagascar - 9818: 664767 # Mortal Kombat: Mortal Kombat Legends: Scorpion's Revenge - 171732: 39410 # Rebirth of Mothra: Mothra - 8581: 6466, 23437 # A Nightmare on Elm Street: Freddy vs. Jason, A Nightmare on Elm Street - 627517: 13155, 68728 # Oz: Return to Oz, Oz the Great and Powerful - 10789: 157433 # Pet Sematary: Pet Sematary - 708816: 305470, 306264 # Power Rangers: Power Rangers, Power Rangers Super Megaforce: The Legendary Battle - 190435: 687354, 11667 # Street Fighter (Animated): Street Fighter Assassin's Fist, Street Fighter - 1582: 1273 # Teenage Mutant Ninja Turtles: TMNT - 10194: 130925 # Toy Story: Partysaurus Rex - 63043: 73362 # TRON: TRON: The Next Day - 748: 567604 # X-Men: Once Upon a Deadpool - ``` + ???+ tip - **Default `name_mapping`**: + Pass `movie_<>` and `name_mapping_<>` to the file as template variables and you can change these + values. ```yaml - 1565: 28 Days-Weeks Later - 508334: Angels in the - 115838: Escape From - 386534: Has Fallen - 87359: Mission Impossible - 133352: Resident Evil Biohazard - 115575: Star Trek Alternate Reality - 115570: Star Trek The Next Generation - 151: Star Trek The Original Series - 10: Star Wars Skywalker Saga - ``` \ No newline at end of file + movie: {% + include-markdown "../../../defaults/movie/franchise.yml" + comments=false + preserve-includer-indent=false + start="template_variables:" + %} + ``` diff --git a/docs/pmm/guides/overview.md b/docs/pmm/guides/overview.md index c198b445..c33dac82 100644 --- a/docs/pmm/guides/overview.md +++ b/docs/pmm/guides/overview.md @@ -34,7 +34,9 @@ A lot of these guides are stored on Google Drive as using the traditional wiki p ## Associated Git Repos - [Plex Meta Manager User Configs](https://github.com/meisnate12/Plex-Meta-Manager-Configs) - - PMM's User submitted Config Repo + - PMM's User submitted Config Repo + +
- [Plex Image Cleanup](https://github.com/meisnate12/Plex-Image-Cleanup) - Removes Image bloat from your Plex @@ -49,6 +51,8 @@ A lot of these guides are stored on Google Drive as using the traditional wiki p - [PMM TOP10](https://github.com/meisnate12/PMM-TOP10) - How PMM stores the Flixpatrol Top 10 Lists +
+ - [ArrAPI](https://github.com/meisnate12/ArrAPI) - Module to interface with Radarr/Sonarr - [TMDbAPIs](https://github.com/meisnate12/TMDbAPIs) @@ -56,6 +60,8 @@ A lot of these guides are stored on Google Drive as using the traditional wiki p - [pmmutils](https://github.com/meisnate12/pmmutils) - Module for various common files among PMM Repos +
+ - [Plex-Meta-Manager-Images](https://github.com/meisnate12/Plex-Meta-Manager-Images) - Repo to store PMM's various Images - [Plex-Meta-Manager-People](https://github.com/meisnate12/Plex-Meta-Manager-People) @@ -75,6 +81,8 @@ A lot of these guides are stored on Google Drive as using the traditional wiki p - [Transparent (transparent)](https://github.com/meisnate12/Plex-Meta-Manager-People-transparent) - Stores the Transparent actor posters +
+ - [Plex-Meta-Manager-Unraid-Templates](https://github.com/meisnate12/Plex-Meta-Manager-Unraid-Templates) - Stores the PMM Unraid Templates - [PMM-Translations ](https://github.com/meisnate12/PMM-Translations) diff --git a/docs/pmm/scripts/image-cleanup.md b/docs/pmm/scripts/image-cleanup.md index 8a8bce2c..5940e618 100644 --- a/docs/pmm/scripts/image-cleanup.md +++ b/docs/pmm/scripts/image-cleanup.md @@ -1,4 +1,13 @@ {% include-markdown "https://raw.githubusercontent.com/meisnate12/Plex-Image-Cleanup/develop/README.md" rewrite-relative-urls=true + comments=false + end="![](cleanup.png)" +%} +![](images/cleanup.png) +{% + include-markdown "https://raw.githubusercontent.com/meisnate12/Plex-Image-Cleanup/develop/README.md" + rewrite-relative-urls=true + comments=false + start="![](cleanup.png)" %} \ No newline at end of file diff --git a/docs/pmm/scripts/overlay-reset.md b/docs/pmm/scripts/overlay-reset.md index 7ad057b6..352b3748 100644 --- a/docs/pmm/scripts/overlay-reset.md +++ b/docs/pmm/scripts/overlay-reset.md @@ -1,135 +1,5 @@ -# Plex Meta Manager Overlay Reset - -Plex Meta Manager Overlay Reset is an open source Python 3 project that has been created to Remove all Overlays placed on a Plex Library. - -## Installing PMM Overlay Reset - -Generally, PMM Overlay Reset can be installed in one of two ways: - -1. Running on a system as a Python script [we will refer to this as a "local" install] -2. Running as a Docker container - -GENERALLY SPEAKING, running as a Docker container is simpler, as you won't have to be concerned about installing Python, or support libraries, or any possible system conflicts generated by those actions. - -For this reason, it's generally recommended that you install via Docker rather than directly on the host. - -If you have some specific reason to avoid Docker, or you prefer running it as a Python script for some particular reason, then this general recommendation is not aimed at you. It's aimed at someone who doesn't have an existing compelling reason to choose one over the other. - -### Install Walkthroughs - -There are no detailed walkthroughs specifically for PMM Overlay Reset but the process is extremely similar to how you would do it with [Plex Meta Manager](https://metamanager.wiki/en/latest/pmm/installation/#install-walkthroughs). - -### Local Install Overview - -PMM Overlay Reset is compatible with Python 3.11. Later versions may function but are untested. - -These are high-level steps which assume the user has knowledge of python and pip, and the general ability to troubleshoot issues. - -1. Clone or [download and unzip](https://github.com/meisnate12/PMM-Overlay-Reset/archive/refs/heads/master.zip) the repo. - -```shell -git clone https://github.com/meisnate12/PMM-Overlay-Reset -``` -2. Install dependencies: - -```shell -pip install -r requirements.txt -``` - -3. If the above command fails, run the following command: - -```shell -pip install -r requirements.txt --ignore-installed -``` - -At this point PMM-Overlay-Reset has been installed, and you can verify installation by running: - -```shell -python pmm_overlay_reset.py -``` - -### Docker Install Overview - -#### Docker Run: - -```shell -docker run -v :/config:rw meisnate12/pmm-overlay-reset -``` -* The `-v :/config:rw` flag mounts the location you choose as a persistent volume to store your files. - * Change `` to a folder where your .env and other files are. - * If your directory has spaces (such as "My Documents"), place quotation marks around your directory pathing as shown here: `-v ":/config:rw"` - -Example Docker Run command: - -These docs are assuming you have a basic understanding of Docker concepts. One place to get familiar with Docker would be the [official tutorial](https://www.docker.com/101-tutorial/). - -```shell -docker run -v "X:\Media\PMM Overlay Reset\config:/config:rw" meisnate12/pmm-overlay-reset -``` - -#### Docker Compose: - -Example Docker Compose file: -```yaml -version: "2.1" -services: - pmm-overlay-reset: - image: meisnate12/pmm-overlay-reset - container_name: pmm-overlay-reset - environment: - - TZ=TIMEZONE #optional - volumes: - - /path/to/config:/config - restart: unless-stopped -``` - -#### Dockerfile - -A `Dockerfile` is included within the GitHub repository for those who require it, although this is only suggested for those with knowledge of dockerfiles. The official PMM Overlay Reset build is available on the [Dockerhub Website](https://hub.docker.com/r/meisnate12/pmm-overlay-reset). - -## Options - -Each option can be applied in three ways: - -1. Use the Shell Command when launching. -2. Setting the Environment Variable. -3. Adding the Environment Variables to `config/.env` - -| Option | Description | Required | -|:------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------:| -| Plex URl | Plex URL of the Server you want to connect to.
**Shell Command:** `-u` or `--url "http://192.168.1.12:32400"`
**Environment Variable:** `PLEX_URL=http://192.168.1.12:32400` | :fontawesome-solid-circle-check:{ .green } | -| Plex Token | Plex Token of the Server you want to connect to.
**Shell Command:** `-t` or `--token 123456789`
**Environment Variable:** `PLEX_TOKEN=123456789` | :fontawesome-solid-circle-check:{ .green } | -| Plex Library | Plex Library Name you want to reset.
**Shell Command:** `-l` or `--library Movies`
**Environment Variable:** `PLEX_LIBRARY=Movies` | :fontawesome-solid-circle-check:{ .green } | -| PMM Asset Folder | Plex Meta Manager Asset Folder to Scan for restoring posters.
**Shell Command:** `-a` or `--asset "C:\Plex Meta Manager\config\assets"`
**Environment Variable:** `PMM_ASSET=C:\Plex Meta Manager\config\assets` | :fontawesome-solid-circle-xmark:{ .red } | -| PMM Original Folder | Plex Meta Manager Original Folder to Scan for restoring posters.
**Shell Command:** `-o` or `--original "C:\Plex Meta Manager\config\overlays\Movies Original Posters"`
**Environment Variable:** `PMM_ORIGINAL=C:\Plex Meta Manager\config\overlays\Movies Original Posters` | :fontawesome-solid-circle-xmark:{ .red } | -| TMDb V3 API Key | TMDb V3 API Key for restoring posters from TMDb.
**Shell Command:** `-ta` or `--tmdbapi 123456789123456789`
**Environment Variable:** `TMDBAPI=123456789123456789` | :fontawesome-solid-circle-xmark:{ .red } | -| Start From | Plex Item Title to Start restoring posters from.
**Shell Command:** `-st` or `--start "Mad Max"`
**Environment Variable:** `START=Mad Max` | :fontawesome-solid-circle-xmark:{ .red } | -| Items | Restore specific Plex Items by Title. Can use a bar-separated (|) list.
**Shell Command:** `-it` or --items "Mad Max|Mad Max 2"
**Environment Variable:** ITEMS=Mad Max|Mad Max 2 | :fontawesome-solid-circle-xmark:{ .red } | -| Timeout | Timeout can be any number greater than 0. **Default:** `600`
**Shell Command:** `-ti` or `--timeout 1000`
**Environment Variable:** `TIMEOUT=1000` | :fontawesome-solid-circle-xmark:{ .red } | -| Dry Run | Run as a Dry Run without making changes in Plex.
**Shell Command:** `-d` or `--dry`
**Environment Variable:** `DRY_RUN=True` | :fontawesome-solid-circle-xmark:{ .red } | -| Flat Assets | PMM Asset Folder uses [Flat Assets Image Paths](../guides/assets.md#asset-naming).
**Shell Command:** `-f` or `--flat`
**Environment Variable:** `PMM_FLAT=True` | :fontawesome-solid-circle-xmark:{ .red } | -| Reset Season Posters | Restore Season posters during run.
**Shell Command:** `-s` or `--season`
**Environment Variable:** `SEASON=True` | :fontawesome-solid-circle-xmark:{ .red } | -| Reset Episode Posters | Restore Episode posters during run.
**Shell Command:** `-e` or `--episode`
**Environment Variable:** `EPISODE=True` | :fontawesome-solid-circle-xmark:{ .red } | -| Ignore Automatic Resume | Ignores the automatic resume.
**Shell Command:** `-ir` or `--ignore-resume`
**Environment Variable:** `IGNORE_RESUME=True` | :fontawesome-solid-circle-xmark:{ .red } | -| Trace Logs | Run with extra trace logs.
**Shell Command:** `-tr` or `--trace`
**Environment Variable:** `TRACE=True` | :fontawesome-solid-circle-xmark:{ .red } | -| Log Requests | Run with every request logged.
**Shell Command:** `-lr` or `--log-requests`
**Environment Variable:** `LOG_REQUESTS=True` | :fontawesome-solid-circle-xmark:{ .red } | - -### Example .env File -``` -PLEX_URL=http://192.168.1.12:32400 -PLEX_TOKEN=123456789 -PLEX_LIBRARY=Movies -PMM_ASSET=C:\Plex Meta Manager\config\assets -PMM_ORIGINAL=C:\Plex Meta Manager\config\overlays\Movies Original Posters -TMDBAPI=123456789123456789 -START= -ITEMS= -TIMEOUT=600 -DRY_RUN=True -PMM_FLAT=False -SEASON=True -EPISODE=True -IGNORE_RESUME=False -TRACE=False -LOG_REQUESTS=False -``` +{% + include-markdown "https://raw.githubusercontent.com/meisnate12/PMM-Overlay-Reset/develop/README.md" + rewrite-relative-urls=true + comments=false +%} \ No newline at end of file diff --git a/docs/pmm/scripts/overview.md b/docs/pmm/scripts/overview.md index fd2f239d..b00b86d7 100644 --- a/docs/pmm/scripts/overview.md +++ b/docs/pmm/scripts/overview.md @@ -2,7 +2,7 @@ Each Companion Script is a separate project that has its own Docker container and GitHub Repository. -| Name | Description | Readme | -|:---------------------|:------------------------------------------------------|:----------------------------------------------------------------------------------------------| +| Name | Description | Readme | +|:---------------------|:------------------------------------------------------|:--------------------------------------------------------------------------------------| | `PMM Overlay Reset` | Script to completely remove all PMM applied Overlays. | [Wiki](overlay-reset.md)/[GitHub](https://github.com/meisnate12/PMM-overlay-reset.md) | | `Plex Image Cleanup` | Script to clean up Plex's Image Cache. | [Wiki](image-cleanup.md)/[GitHub](https://github.com/meisnate12/Plex-Image-Cleanup) | diff --git a/modules/builder.py b/modules/builder.py index 7db3de33..7a6c7aaf 100644 --- a/modules/builder.py +++ b/modules/builder.py @@ -164,7 +164,7 @@ parts_collection_valid = [ "filters", "plex_all", "plex_search", "trakt_list", "trakt_list_details", "collection_filtering", "collection_mode", "label", "visible_library", "limit", "visible_home", "visible_shared", "show_missing", "save_report", "missing_only_released", "server_preroll", "changes_webhooks", "item_lock_background", "item_lock_poster", "item_lock_title", "item_refresh", "item_refresh_delay", "imdb_list", "imdb_search", - "cache_builders", "url_theme", "file_theme", "item_label", "default_percent" + "cache_builders", "url_theme", "file_theme", "item_label", "default_percent", "non_item_remove_label" ] + episode_parts_only + summary_details + poster_details + background_details + string_details playlist_attributes = [ "filters", "name_mapping", "show_filtered", "show_missing", "save_report", "allowed_library_types", "run_definition", @@ -1598,7 +1598,7 @@ class CollectionBuilder: if res: events.append(res.group(1)) else: - raise Failed(f"{method_name} {search_method} attribute: {search_data} must match pattern ev\d+ e.g. ev0000292 or be one of {', '.join([e for e in imdb.event_options])}") + raise Failed(f"{method_name} {search_method} attribute: {search_data} must match pattern ev\\d+ e.g. ev0000292 or be one of {', '.join([e for e in imdb.event_options])}") if events: new_dictionary[lower_method] = events elif search_attr == "company": @@ -1611,7 +1611,7 @@ class CollectionBuilder: if res: companies.append(res.group(1)) else: - raise Failed(f"{method_name} {search_method} attribute: {search_data} must match pattern co\d+ e.g. co0098836 or be one of {', '.join([e for e in imdb.company_options])}") + raise Failed(f"{method_name} {search_method} attribute: {search_data} must match pattern co\\d+ e.g. co0098836 or be one of {', '.join([e for e in imdb.company_options])}") if companies: new_dictionary[lower_method] = companies elif search_attr == "content_rating": @@ -1652,7 +1652,7 @@ class CollectionBuilder: if res: casts.append(res.group(1)) else: - raise Failed(f"{method_name} {search_method} attribute: {search_data} must match pattern nm\d+ e.g. nm00988366") + raise Failed(f"{method_name} {search_method} attribute: {search_data} must match pattern nm\\d+ e.g. nm00988366") if casts: new_dictionary[lower_method] = casts elif search_attr == "series": @@ -1662,7 +1662,7 @@ class CollectionBuilder: if res: series.append(res.group(1)) else: - raise Failed(f"{method_name} {search_method} attribute: {search_data} must match pattern tt\d+ e.g. tt00988366") + raise Failed(f"{method_name} {search_method} attribute: {search_data} must match pattern tt\\d+ e.g. tt00988366") if series: new_dictionary[lower_method] = series elif search_attr == "list": @@ -1672,7 +1672,7 @@ class CollectionBuilder: if res: lists.append(res.group(1)) else: - raise Failed(f"{method_name} {search_method} attribute: {search_data} must match pattern ls\d+ e.g. ls000024621") + raise Failed(f"{method_name} {search_method} attribute: {search_data} must match pattern ls\\d+ e.g. ls000024621") if lists: new_dictionary[lower_method] = lists elif search_attr == "adult": diff --git a/modules/config.py b/modules/config.py index bc3c2bd1..23cc69c4 100644 --- a/modules/config.py +++ b/modules/config.py @@ -864,10 +864,12 @@ class ConfigFile: } if op == "metadata_backup": default_path = os.path.join(default_dir, f"{str(library_name)}_Metadata_Backup.yml") - try: - default_path = check_for_attribute(input_dict, "path", var_type="path", save=False) - except Failed as e: - logger.debug(f"{e} using default {default_path}") + if "path" not in input_dict: + logger.warning(f"Config Warning: path attribute not found using default: {default_path}") + if "path" in input_dict and not input_dict["path"]: + logger.warning(f"Config Warning: path attribute blank using default: {default_path}") + else: + default_path = input_dict["path"] section_final[op] = { "path": default_path, "exclude": check_for_attribute(input_dict, "exclude", var_type="lower_list", default_is_none=True, save=False), @@ -934,8 +936,6 @@ class ConfigFile: params["collection_files"] = files elif not had_scheduled: raise Failed("Config Error: No Paths Found for collection_files") - elif os.path.exists(os.path.join(default_dir, f"{library_name}.yml")): - params["collection_files"] = [("File", os.path.join(default_dir, f"{library_name}.yml"), lib_vars, None)] except Failed as e: logger.error(e)