From 55b7ca9cd42f44bb44b6cdfb9bde8aaf7bac1683 Mon Sep 17 00:00:00 2001 From: Chaz Larson Date: Fri, 6 Oct 2023 14:45:12 -0500 Subject: [PATCH] Remove cache-libraries due to odd behavior --- docs/home/environmental.md | 34 ---------------------------------- plex_meta_manager.py | 7 ------- 2 files changed, 41 deletions(-) diff --git a/docs/home/environmental.md b/docs/home/environmental.md index 46e2e409..ba1f556e 100644 --- a/docs/home/environmental.md +++ b/docs/home/environmental.md @@ -28,7 +28,6 @@ Environment Variables can also be placed inside a `.env` file inside your config | [Libraries First](#libraries-first) | `-lf` or `--libraries-first` | `PMM_LIBRARIES_FIRST` | | [Ignore Schedules](#ignore-schedules) | `-is` or `--ignore-schedules` | `PMM_IGNORE_SCHEDULES` | | [Ignore Ghost](#ignore-ghost) | `-ig` or `--ignore-ghost` | `PMM_IGNORE_GHOST` | -| [Cache Libraries](#cache-libraries) | `-ca` or `--cache-libraries` | `PMM_CACHE_LIBRARIES` | | [Delete Collections](#delete-collections) | `-dc` or `--delete-collections` | `PMM_DELETE_COLLECTIONS` | | [Delete Labels](#delete-labels) | `-dl` or `--delete-labels` | `PMM_DELETE_LABELS` | | [Resume Run](#resume-run) | `-re` or `--resume` | `PMM_RESUME` | @@ -678,39 +677,6 @@ docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex ``` ```` -### Cache Libraries - -Cache the library Load for 1 day. - - - - - - - - - - - - - - - - - -
ShellEnvironment
Flags-ca or --cache-librariesPMM_CACHE_LIBRARIES
Example--cache-librariesPMM_CACHE_LIBRARIES=true
- -````{tab} Local Environment -``` -python plex_meta_manager.py --cache-libraries -``` -```` -````{tab} Docker Environment -``` -docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex-meta-manager --cache-libraries -``` -```` - ### Delete Collections Delete all collections in a Library prior to running collections/operations. diff --git a/plex_meta_manager.py b/plex_meta_manager.py index 12ca9179..e983291d 100644 --- a/plex_meta_manager.py +++ b/plex_meta_manager.py @@ -41,7 +41,6 @@ arguments = { "libraries-first": {"args": ["lf", "library-first"], "type": "bool", "help": "Run library operations before collections"}, "ignore-schedules": {"args": "is", "type": "bool", "help": "Run ignoring collection schedules"}, "ignore-ghost": {"args": "ig", "type": "bool", "help": "Run ignoring ghost logging"}, - "cache-libraries": {"args": ["ca", "cache-library"], "type": "bool", "help": "Cache Library load for 1 day"}, "delete-collections": {"args": ["dc", "delete", "delete-collection"], "type": "bool", "help": "Deletes all Collections in the Plex Library before running"}, "delete-labels": {"args": ["dl", "delete-label"], "type": "bool", "help": "Deletes all Labels in the Plex Library before running"}, "resume": {"args": "re", "type": "str", "help": "Resume collection run from a specific collection"}, @@ -556,17 +555,11 @@ def run_libraries(config): expired = None if config.Cache: list_key, expired = config.Cache.query_list_cache("library", library.mapping_name, 1) - if run_args["cache-libraries"] and list_key and expired is False: - logger.info(f"Library: {library.mapping_name} loaded from Cache") - temp_items = config.Cache.query_list_ids(list_key) if not temp_items: temp_items = library.cache_items() if config.Cache and list_key: config.Cache.delete_list_ids(list_key) - if config.Cache and run_args["cache-libraries"]: - list_key = config.Cache.update_list_cache("library", library.mapping_name, expired, 1) - config.Cache.update_list_ids(list_key, [(i.ratingKey, i.guid) for i in temp_items]) if not library.is_music: logger.info("") logger.separator(f"Mapping {library.original_mapping_name} Library", space=False, border=False)