Remove cache-libraries due to odd behavior

pull/1645/head
Chaz Larson 1 year ago
parent c01df04dca
commit 55b7ca9cd4

@ -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` | | [Libraries First](#libraries-first) | `-lf` or `--libraries-first` | `PMM_LIBRARIES_FIRST` |
| [Ignore Schedules](#ignore-schedules) | `-is` or `--ignore-schedules` | `PMM_IGNORE_SCHEDULES` | | [Ignore Schedules](#ignore-schedules) | `-is` or `--ignore-schedules` | `PMM_IGNORE_SCHEDULES` |
| [Ignore Ghost](#ignore-ghost) | `-ig` or `--ignore-ghost` | `PMM_IGNORE_GHOST` | | [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 Collections](#delete-collections) | `-dc` or `--delete-collections` | `PMM_DELETE_COLLECTIONS` |
| [Delete Labels](#delete-labels) | `-dl` or `--delete-labels` | `PMM_DELETE_LABELS` | | [Delete Labels](#delete-labels) | `-dl` or `--delete-labels` | `PMM_DELETE_LABELS` |
| [Resume Run](#resume-run) | `-re` or `--resume` | `PMM_RESUME` | | [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.
<table class="dualTable colwidths-auto align-default table">
<tr>
<th style="background-color: #1d1d1d;"></th>
<th>Shell</th>
<th>Environment</th>
</tr>
<tr>
<th>Flags</th>
<td><code>-ca</code> or <code>--cache-libraries</code></td>
<td><code>PMM_CACHE_LIBRARIES</code></td>
</tr>
<tr>
<th>Example</th>
<td><code>--cache-libraries</code></td>
<td><code>PMM_CACHE_LIBRARIES=true</code></td>
</tr>
</table>
````{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 Collections
Delete all collections in a Library prior to running collections/operations. Delete all collections in a Library prior to running collections/operations.

@ -41,7 +41,6 @@ arguments = {
"libraries-first": {"args": ["lf", "library-first"], "type": "bool", "help": "Run library operations before collections"}, "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-schedules": {"args": "is", "type": "bool", "help": "Run ignoring collection schedules"},
"ignore-ghost": {"args": "ig", "type": "bool", "help": "Run ignoring ghost logging"}, "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-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"}, "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"}, "resume": {"args": "re", "type": "str", "help": "Resume collection run from a specific collection"},
@ -556,17 +555,11 @@ def run_libraries(config):
expired = None expired = None
if config.Cache: if config.Cache:
list_key, expired = config.Cache.query_list_cache("library", library.mapping_name, 1) 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: if not temp_items:
temp_items = library.cache_items() temp_items = library.cache_items()
if config.Cache and list_key: if config.Cache and list_key:
config.Cache.delete_list_ids(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: if not library.is_music:
logger.info("") logger.info("")
logger.separator(f"Mapping {library.original_mapping_name} Library", space=False, border=False) logger.separator(f"Mapping {library.original_mapping_name} Library", space=False, border=False)

Loading…
Cancel
Save