Plex-Meta-Manager/docs/home/environmental.md
2023-02-05 14:10:08 -05:00

29 KiB

Run Commands & Environment Variables

This table outlines the run commands and environment variables that can be utilized to customize the running of Plex Meta Manager to the user's requirements. Environment Variable values are used over Shell Command values.

If you run into a race condition where you have set an Environment Variable within your system and also use a Shell Command for the same attribute, then the Environment Variable will take priority.

These docs are assuming you have a basic understanding of Docker concepts. One place to get familiar with Docker would be the official tutorial.

Attribute Shell Command Environment Variable
Config -c or --config PMM_CONFIG
Time to Run -t or --time PMM_TIME
Run Immediately -r or --run PMM_RUN
Run Tests -rt, --tests, or --run-tests PMM_TEST
Debug -db or --debug PMM_DEBUG
Trace -tr or --trace PMM_TRACE
Log Requests -lr or --log-requests PMM_LOG_REQUESTS
Timeout -ti or --timeout PMM_TIMEOUT
Collections Only -co or --collections-only PMM_COLLECTIONS_ONLY
Playlists Only -po or --playlists-only PMM_PLAYLISTS_ONLY
Operations Only -op, --operations, or --operations-only PMM_OPERATIONS
Overlays Only -ov, --overlays, or --overlays-only PMM_OVERLAYS
Run Collections -rc or --run-collections PMM_COLLECTIONS
Run Libraries -rl or --run-libraries PMM_LIBRARIES
Run Metadata Files -rm or --run-metadata-files PMM_METADATA_FILES
Libraries First -lf or --libraries-first PMM_LIBRARIES_FIRST
Ignore Schedules -is or --ignore-schedules PMM_IGNORE_SCHEDULES
Ignore Ghost -ig or --ignore-ghost PMM_IGNORE_GHOST
Cache Libraries -ca or --cache-libraries PMM_CACHE_LIBRARIES
Delete Collections -dc or --delete-collections PMM_DELETE_COLLECTIONS
Delete Labels -dl or --delete-labels PMM_DELETE_LABELS
Resume Run -re or --resume PMM_RESUME
No Countdown -nc or --no-countdown PMM_NO_COUNTDOWN
No Missing -nm or --no-missing PMM_NO_MISSING
No Report -nr or --no-report PMM_NO_REPORT
Read Only Config -ro or --read-only-config PMM_READ_ONLY_CONFIG
ENV Plex URL -pu or --plex-url PMM_PLEX_URL
ENV Plex Token -pt or --plex-token PMM_PLEX_TOKEN
Divider Character -d or --divider PMM_DIVIDER
Screen Width -w or --width PMM_WIDTH

Further explanation and examples of each command can be found below.

Run Command Attribute Examples

Environment variables are expressed as KEY=VALUE Depending on the context where you are specifying them, you may enter those two things in two different fields, or some other way. The examples below show how you would specify the environment variable in a script or a docker run command. Things like Portainer or a NAS Docker UI will have different ways to specify these things.

Config

Specify the location of the configuration YAML file.

Shell Environment
Flags -c or --config PMM_CONFIG
Example --config /data/config.yml PMM_CONFIG=/data/config.yml
Default config/config.yml
Values Path to YAML config file
```
python plex_meta_manager.py --config <path_to_config>
```
```
docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex-meta-manager --config <path_to_config>
```

Time to Run

Specify the time of day that Plex Meta Manager will run.

Shell Environment
Flags -t or --time PMM_TIME
Example --time 06:00,18:00 PMM_TIME=06:00,18:00
Default Value 05:00
Available Values comma-separated list in HH:MM format
```
python plex_meta_manager.py --time 22:00,03:00
```
```
docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex-meta-manager --time 22:00,03:00
```

Run Immediately

Perform a run immediately, bypassing the time to run flag.

Shell Environment
Flags -r or --run PMM_RUN
Example --run PMM_RUN=true

```
python plex_meta_manager.py --run
```
```
docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex-meta-manager --run
```

Run Tests

Perform a debug test run immediately, bypassing the time to run flag. This will only run collections with test: true in the definition.

Shell Environment
Flags -rt, --tests, or --run-tests PMM_TEST
Example --run-tests PMM_TEST=true
  • Only collections with test: true enabled will be run
```
python plex_meta_manager.py --run-tests
```
```
docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex-meta-manager --run-tests
```

Debug

Run with Debug Logs Reporting to the Command Window.

Shell Environment
Flags -db or --debug PMM_DEBUG
Example --debug PMM_DEBUG=true
```
python plex_meta_manager.py --debug
```
```
docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex-meta-manager --debug
```

Trace

Run with extra Trace Debug Logs.

Shell Environment
Flags -tr or --trace PMM_TRACE
Example --trace PMM_TRACE=true
```
python plex_meta_manager.py --trace
```
```
docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex-meta-manager --trace
```

Log Requests

Run with every network request printed to the Logs. This can potentially have personal information in it.

Shell Environment
Flags -lr or --log-request or --log-requests PMM_LOG_REQUESTS
Example --log-requests PMM_NETWORK=true
```
python plex_meta_manager.py --log-requests
```
```
docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex-meta-manager --log-requests
```

Timeout

Change the timeout for all non-Plex services (such as TMDb, Radarr, and Trakt). This is overwritten by any timeouts mentioned for specific services in the Configuration File.

Shell Environment
Flags -ti or --timeout PMM_TIMEOUT
Example --timeout 360 PMM_TIMEOUT=360
Values Integer Number of Seconds
```
python plex_meta_manager.py --timeout 360
```
```
docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex-meta-manager --timeout 360
```

Collections Only

Only run collection metadata/YAML files, skip library operations, overlays, and playlists.

Shell Environment
Flags -co or --collections-only PMM_COLLECTIONS_ONLY
Example --collections-only PMM_COLLECTIONS_ONLY=true
```
python plex_meta_manager.py --collections-only
```
```
docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex-meta-manager --collections-only
```

Playlists Only

Only run playlist metadata/YAML files, skip library operations, overlays, and collections/metadata.

Shell Environment
Flags -po or --playlists-only PMM_PLAYLISTS_ONLY
Example --playlists-only PMM_PLAYLISTS_ONLY=true
```
python plex_meta_manager.py --playlists-only
```
```
docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex-meta-manager --playlists-only
```

Operations Only

Only run library operations skipping collections/metadata, playlists, and overlays.

Shell Environment
Flags -op or --operations PMM_OPERATIONS
Example --operations PMM_OPERATIONS=true
```
python plex_meta_manager.py --operations
```
```
docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex-meta-manager --operations
```

Overlays Only

Only run library overlays skipping collections/metadata, playlists, and operations.

Shell Environment
Flags -ov or --overlays PMM_OVERLAYS
Example --overlays PMM_OVERLAYS=true
```
python plex_meta_manager.py --overlays
```
```
docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex-meta-manager --overlays
```

Run Collections

Perform a collections run immediately to run only the pre-defined collections, bypassing the time to run flag.

Shell Environment
Flags -rc or --run-collections PMM_COLLECTIONS
Example --run-collections "Harry Potter|Star Wars" PMM_COLLECTIONS=Harry Potter|Star Wars
Values Pipe-separated list of Collection Names to run
```
python plex_meta_manager.py --run-collections "Harry Potter|Star Wars"
```
```
docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex-meta-manager --run-collections "Harry Potter|Star Wars"
```

Run Libraries

Perform a libraries run immediately to run only the pre-defined libraries, bypassing the time to run flag.

Shell Environment
Flags -rl or --run-libraries PMM_LIBRARIES
Example --run-libraries "Movies - 4K|TV Shows - 4K" PMM_LIBRARIES=Movies - 4K|TV Shows - 4K
Values Pipe-separated list of Library Names to run
```
python plex_meta_manager.py --run-libraries "TV Shows"
```
```
docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex-meta-manager --run-libraries "TV Shows"
```

Run Metadata Files

Perform a metadata files run immediately to run only the pre-defined metadata files, bypassing the time to run flag.

Shell Environment
Flags -rm or --run-metadata-files PMM_METADATA_FILES
Example --run-metadata-files "Movies.yml|MovieCharts" PMM_METADATA_FILES=Movies.yml|MovieCharts
Available Values Pipe-separated list of Metadata Filenames to run
  • This works for all different metadata paths i.e. git, url, file, or repo.
```
python plex_meta_manager.py --run-metadata-files "Movies"
```
```
docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex-meta-manager --run-metadata-files "Movies"
```

Libraries First

Run library operations prior to running collections.

Shell Environment
Flags -lf or --libraries-first PMM_LIBRARIES_FIRST
Example --libraries-first PMM_LIBRARIES_FIRST=true
```
python plex_meta_manager.py --libraries-first
```
```
docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex-meta-manager --libraries-first
```

Ignore Schedules

Ignore all schedules for the run.

Shell Environment
Flags -is or --ignore-schedules PMM_IGNORE_SCHEDULES
Example --ignore-schedules PMM_IGNORE_SCHEDULES=true
  • Range Scheduled collections (such as Christmas movies) will still be ignored.
```
python plex_meta_manager.py --ignore-schedules
```
```
docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex-meta-manager --ignore-schedules
```

Ignore Ghost

Ignore all ghost logging for the run. A ghost log is what's printed to the console to show progress during steps.

Shell Environment
Flags -ig or --ignore-ghost PMM_IGNORE_GHOST
Example --ignore-ghost PMM_IGNORE_GHOST=true
```
python plex_meta_manager.py --ignore-ghost
```
```
docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex-meta-manager --ignore-ghost
```

Cache Libraries

Cache the library Load for 1 day.

Shell Environment
Flags -ca or --cache-libraries PMM_CACHE_LIBRARIES
Example --cache-libraries PMM_CACHE_LIBRARIES=true
```
python plex_meta_manager.py --cache-libraries
```
```
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.

Shell Environment
Flags -dc or --delete-collections PMM_DELETE_COLLECTIONS
Example --delete-collections PMM_DELETE_COLLECTIONS=true
```
python plex_meta_manager.py --delete-collections
```
```
docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex-meta-manager --delete-collections
```

Delete Labels

Delete all labels on every item in a Library prior to running collections/operations.

Shell Environment
Flags -dl or --delete-labels PMM_DELETE_LABELS
Example --delete-labels PMM_DELETE_LABELS=true
```
python plex_meta_manager.py --delete-labels
```
```
docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex-meta-manager --delete-labels
```

Resume Run

Perform a resume run immediately resuming from the first instance of the specified collection, bypassing the time to run flag.

Shell Environment
Flags -re or --resume PMM_RESUME
Example --resume "Star Wars" PMM_RESUME=Star Wars
Available Values Name of collection to resume from
```
python plex_meta_manager.py --resume "Star Wars"
```
```
docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex-meta-manager --resume "Star Wars"
```

No Countdown

Run without displaying a countdown to the next scheduled run.

Shell Environment
Flags -nc or --no-countdown PMM_NO_COUNTDOWN
Example --no-countdown PMM_NO_COUNTDOWN=true
```
python plex_meta_manager.py --no-countdown
```
```
docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex-meta-manager --no-countdown
```

No Missing

Run without utilizing the missing movie/show functions.

Shell Environment
Flags -nm or --no-missing PMM_NO_MISSING
Example --no-missing PMM_NO_MISSING=true
```
python plex_meta_manager.py --no-missing
```
```
docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex-meta-manager --no-missing
```

No Report

Run without saving the report.

Shell Environment
Flags -nr or --no-report PMM_NO_REPORT
Example --no-report PMM_NO_REPORT=true
```
python plex_meta_manager.py --no-report
```
```
docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex-meta-manager --no-report
```

Read Only Config

Run without writing to the configuration file.

Shell Environment
Flags -ro or --read-only-config PMM_READ_ONLY_CONFIG
Example --read-only-config PMM_READ_ONLY_CONFIG=true
```
python plex_meta_manager.py --read-only-config
```
```
docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex-meta-manager --read-only-config
```

ENV Plex URL & Token

Replaces ENV when it is used plex url or token.

Plex URL

Shell Environment
Flags -pu or --plex-url PMM_PLEX_URL
Example --plex-url 192.168.1.12:32400 PMM_PLEX_URL=192.168.1.12:32400

Plex Token

Shell Environment
Flags -pt or --plex-token PMM_PLEX_TOKEN
Example --plex-token AB23HE4588 PMM_PLEX_TOKEN=AB23HE4588
```
python plex_meta_manager.py --plex-url 192.168.1.12:32400 --plex-token AB23HE4588
```
```
docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex-meta-manager --plex-url 192.168.1.12:32400 --plex-token AB23HE4588
```

Divider Character & Screen Width

Change the terminal output divider character or width.

Divider Character

Shell Environment
Flags -d or --divider PMM_DIVIDER
Example --divider * PMM_DIVIDER=*
Default =
Values A character

Screen Width

Shell Environment
Flags -w or --width PMM_WIDTH
Example --width 150 PMM_WIDTH=150
Default Integer between 90 and 300
Values A character
```
python plex_meta_manager.py --divider * --width 200
```
```
docker run -it -v "X:\Media\Plex Meta Manager\config:/config:rw" meisnate12/plex-meta-manager --divider * --width 200
```