Plex-Meta-Manager/docs/config/libraries.md

252 lines
11 KiB
Markdown
Raw Normal View History

2022-10-29 15:59:01 +00:00
# Library Attributes
2022-03-08 08:06:22 +00:00
## Library Attributes
2022-03-08 08:06:22 +00:00
2022-10-29 15:59:01 +00:00
Within the [Configuration File](configuration), the `libraries` attribute specifies the Plex libraries that the user wants Plex Meta Manager to act on.
2022-03-08 08:06:22 +00:00
Attributes are used to instruct Plex Meta Manager what actions to take, such as "load the following libraries" or "execute the following Collection Definition files". These attributes can be specified individually per library, or can be inherited from the global value if it has been set. If an attribute is specified at both the library and global level, then the library level attribute will take priority.
### Example
2022-03-08 08:06:22 +00:00
This example is an advanced version of the library mappings which highlights some attributes being set at the global level, and some being set at the library level:
<details>
<summary>Click to Expand</summary>
In this example, the `"TV Shows On Second Plex"` library has a library-level `plex` configuration, which takes priority over the `plex` configuration set at the global level. <br>
The `"Anime"` library also has a library-level `radarr` configuration, which takes priority over the `radarr` configuration set at the global level.
```yaml
libraries:
Movies:
metadata_path:
- file: config/Movies.yml
- pmm: imdb
- pmm: studio
- pmm: genre
- pmm: actor
2022-03-08 08:06:22 +00:00
operations:
mass_critic_rating_update: tmdb
split_duplicates: true
TV Shows:
metadata_path:
- file: config/TV Shows.yml
- pmm: tmdb
- pmm: network
2022-04-18 18:16:39 +00:00
overlay_path:
2022-05-18 17:07:15 +00:00
- remove_overlays: false
2022-04-18 18:16:39 +00:00
- file: config/Overlays.yml
2022-03-08 08:06:22 +00:00
TV Shows On Second Plex:
library_name: TV Shows
plex:
url: http://192.168.1.98:32400
token: ####################
metadata_path:
- file: config/TV Shows.yml
- pmm: tmdb
- pmm: network
2022-03-08 08:06:22 +00:00
Anime:
metadata_path:
- file: config/Anime.yml
- pmm: myanimelist
2022-03-08 08:06:22 +00:00
radarr:
url: http://192.168.1.45:7878
token: ################################
root_folder_path: S:/Anime
settings:
2022-12-13 21:12:59 +00:00
asset_directory: config/assets/anime
2022-03-08 08:06:22 +00:00
plex:
url: http://192.168.1.12:32400
token: ####################
radarr:
url: http://192.168.1.12:7878
token: ################################
add: true
root_folder_path: S:/Movies
monitor: true
availability: announced
quality_profile: HD-1080p
tag: pmm
search: false
```
</details>
### Attributes
2022-03-08 08:06:22 +00:00
The available attributes for each library are as follows:
2022-11-16 14:30:04 +00:00
| Attribute | Values | Default | Required |
|:----------------------------------------------------|:------------------------------------------------------------------------------------------------------|:--------------------------------------|:-------------------------------:|
| [`library_name`](#library-name) | Library name (required only when trying to use multiple libraries with the same name) | Base Attribute Name | &#10060; |
| [`metadata_path`](#metadata-path) | Location of Metadata YAML files | `/config/<<MAPPING_NAME>>.yml` | &#10060; |
| [`overlay_path`](#overlay-path) | Location of Overlay YAML files | None | &#10060; |
2022-10-29 15:59:01 +00:00
| [`report_path`](#report-path) | Location to create the YAML file listing added, removed, filtered, and missing items for this library | `/config/<<MAPPING_NAME>>_report.yml` | &#10060; |
2022-11-16 14:30:04 +00:00
| [`template_variables`](#library-template-variables) | Library template variables to be applied to every Metadata and Overlay file run. | N/A | &#10060; |
| [`schedule`](../metadata/details/schedule) | Use any [schedule option](../metadata/details/schedule) to control when this library is run. | daily | &#10060; |
| [`operations`](operations) | Library Operations to run | N/A | &#10060; |
| [`settings`](settings) | Any `setting` attribute that overrides a global value | global | &#10060; |
| [`plex`](plex) | Any `plex` attribute that overrides a global value | global | &#9989; Either here or globally |
| [`radarr`](radarr) | Any `radarr` attribute that overrides a global value | global | &#10060; |
| [`sonarr`](sonarr) | Any `sonarr` attribute that overrides a global value | global | &#10060; |
| [`tautulli`](tautulli) | Any `tautulli` attribute that overrides a global value | global | &#10060; |
2022-03-08 08:06:22 +00:00
2022-04-10 05:48:23 +00:00
### Library Name
2022-03-08 08:06:22 +00:00
Each library that the user wants Plex Meta Manager to interact with must be documented with a library attribute. A library attribute is represented by the mapping name (i.e. `Movies` or `TV Shows`), this must have a unique name that correlates with a library of the same name within the Plex Media Server. In the situation that two servers are being connected to which both have libraries of the same name, the `library_name` attribute can be utilized to specify the real Library Name, whilst the library attribute's mapping name can be made into a placeholder. This is showcased below:
<details>
2022-12-09 16:52:51 +00:00
<summary>Example</summary>
2022-03-08 08:06:22 +00:00
```yaml
libraries:
Movies01:
library_name: Movies
Movies02:
library_name: Movies
plex:
url: http://192.168.1.35:32400
token: ####################
TV Shows:
Anime:
plex:
url: http://192.168.1.12:32400
token: ####################
```
* In this example, `"Movies01"`, `"TV Shows"`, and `"Anime"` will all use the global plex server (http://192.168.1.12:32400) which is defined using the global `plex` mapping. `"Movies02"` will use the plex server http://192.168.1.35:32400 which is defined under its `plex` mapping over the global mapping.
</details>
### Metadata Path
2022-03-08 08:06:22 +00:00
The `metadata_path` attribute is used to define [Metadata Files](../metadata/metadata) by specifying the path type and path of the files that will be executed against the parent library. See [Path Types](paths) for how to define them.
2022-03-08 08:06:22 +00:00
2022-05-18 17:07:15 +00:00
```yaml
libraries:
TV Shows:
metadata_path:
- file: config/TV Shows.yml
- pmm: tmdb
- pmm: network
2022-05-18 17:07:15 +00:00
```
2022-03-08 08:06:22 +00:00
By default, when `metadata_path` is missing the script will look within the root PMM directory for a metadata file called `<MAPPING_NAME>.yml`. In this example, Plex Meta Manager will look for a file named `TV Shows.yml`.
2022-04-10 05:48:23 +00:00
2022-03-08 08:06:22 +00:00
```yaml
libraries:
TV Shows:
```
2022-04-18 18:16:39 +00:00
### Overlay Path
2022-10-05 15:30:53 +00:00
The `overlay_path` attribute is used to define [Overlay Files](../metadata/overlay) by specifying the path type and path of the files that will be executed against the parent library. See [Path Types](paths) for how to define them.
2022-04-18 18:16:39 +00:00
```yaml
libraries:
TV Shows:
metadata_path:
- file: config/TV Shows.yml
overlay_path:
- file: config/Overlays.yml
```
2022-12-09 16:52:51 +00:00
#### Special Overlay Path Calls
<details>
<summary>Remove Overlays</summary>
2022-04-20 04:06:42 +00:00
2022-07-19 20:33:57 +00:00
You can remove overlays from a library by adding `remove_overlays: true` to `overlay_path`. This will remove all overlays when run and not generate new ones.
2022-04-20 04:06:42 +00:00
```yaml
libraries:
TV Shows:
metadata_path:
- file: config/TV Shows.yml
overlay_path:
2022-04-20 16:03:08 +00:00
- remove_overlays: true
2022-04-20 04:06:42 +00:00
- file: config/Overlays.yml
```
2022-12-09 16:52:51 +00:00
</details>
2022-04-20 04:06:42 +00:00
2022-12-09 16:52:51 +00:00
<details>
<summary>Reapply Overlays</summary>
2022-07-19 20:33:57 +00:00
You can reapply overlays from a library by adding `reapply_overlays: true` to `overlay_path`. This will reapply overlays to every item in your library.
```yaml
libraries:
TV Shows:
metadata_path:
- file: config/TV Shows.yml
overlay_path:
- reapply_overlays: true
- file: config/Overlays.yml
```
2022-12-09 16:52:51 +00:00
</details>
2022-07-19 20:33:57 +00:00
2022-12-09 16:52:51 +00:00
<details>
<summary>Reset Overlays</summary>
2022-07-19 20:33:57 +00:00
You can reset overlays from a library by adding `reset_overlays` to `overlay_path` and setting it to either `tmdb` or `plex` depending on where you want to source the images from. This will use the reset image when overlaying items in your library.
```yaml
libraries:
TV Shows:
metadata_path:
- file: config/TV Shows.yml
overlay_path:
- reset_overlays: plex
- file: config/Overlays.yml
```
2022-12-09 16:52:51 +00:00
</details>
2022-04-20 04:06:42 +00:00
2022-12-09 16:52:51 +00:00
<details>
<summary>Schedule Overlays</summary>
2022-10-17 16:06:32 +00:00
You can schedule all overlays from a library by adding `schedule` to `overlay_path` and setting it to [Any Schedule Option](../metadata/details/schedule).
**You cannot schedule individual Overlay Files.**
```yaml
libraries:
TV Shows:
metadata_path:
- file: config/TV Shows.yml
overlay_path:
- schedule: weekly(sunday)
- file: config/Overlays.yml
```
2022-12-09 16:52:51 +00:00
</details>
2022-10-17 16:06:32 +00:00
### Report Path
2022-03-08 08:06:22 +00:00
The `report_path` attribute is used to define where to save the YAML Report file. This file is used to store information about what media is added, removed, filtered, and missing from the Plex library compared to what is expected from the Metadata file.
2022-03-08 08:06:22 +00:00
If your Metadata file creates a collection with `Movie 1`, `Movie 2` and `Movie 3` but your Plex library only has `Movie 1` and `Movie 3`, then the missing YAML file will be updated to inform the user that `Movie 2` was missing from the library.
The default and recommended path is `/config/<<MAPPING_NAME>>report.yml` where `<<MAPPING_NAME>>` is the name of the library attribute, as showcased below:
2022-03-08 08:06:22 +00:00
```yaml
libraries:
Movies:
report_path: /config/Movies_report.yml
2022-03-08 08:06:22 +00:00
```
Alternatively, Report YAML files can be placed in their own directory, as below:
2022-03-08 08:06:22 +00:00
```yaml
libraries:
Movies:
report_path: /config/reports/Movies.yml
```
2022-10-26 06:56:12 +00:00
### Library Template Variables
2022-06-01 04:50:38 +00:00
Library template variables to be applied to every Metadata and Overlay file run.
```yaml
libraries:
Movies:
2022-06-26 16:31:22 +00:00
template_variables:
2022-10-26 06:56:12 +00:00
collection_mode: hide_items
2022-06-01 04:50:38 +00:00
```