# \_mod\_PLEX

Provider ID: `PLEX`\
Version (module): `3.2.0`

{% tabs %}
{% tab title="End users" %}
Plex support in the sync engine.

Use it to sync:

* watchlist
* history
* ratings
* progress

Setup docs:

* [Auth: Plex](/crosswatch/providers/authentication/auth-media-servers/auth-plex.md)
* [Adapter: Plex](/crosswatch/providers/synchronization/adapter-plex.md)
  {% endtab %}

{% tab title="Power users" %}
**Entry point:** `sync/_mod_PLEX.py`

### Provider surface

* `health()`
* `build_index(feature)`
* `add(feature, items)`
* `remove(feature, items)`

### Features

* `watchlist` → `providers/plex/_watchlist.py`
* `history` → `providers/plex/_history.py`
* `ratings` → `providers/plex/_ratings.py`
* `progress` → `providers/plex/_progress.py`

### Capabilities

* `bidirectional: true`
* `provides_ids: true`
* `index_semantics: "present"`

### Config

Config block name:

* `Plex` or `plex`

Common keys:

* `token`
* `baseurl` (optional; needed for some setups)
* `timeout` (default `10.0`), `max_retries` (default `3`)
* `watchlist_allow_pms_fallback` (default `true`)
* `watchlist_page_size` (default `100`)

### Gotchas

Watchlist writes may prefer Plex Discover.

Allow PMS fallback only if you need it.

<details>

<summary>Runtime call flow</summary>

```
Orchestrator
  └─ OPS.build_index(cfg, feature)
       └─ PLEXModule.build_index(feature)
            └─ providers/plex/_{feature}.py : build_index(adapter, ...)
```

Writes are symmetric:

```
Orchestrator plan → OPS.add/remove(...)
  └─ PLEXModule.add/remove(feature, items, dry_run=...)
       └─ providers/plex/_{feature}.py : add/remove(adapter, items)
```

</details>

<details>

<summary>OPS contract</summary>

* `name()`
* `label()`
* `features()`
* `capabilities()`
* `is_configured(cfg)`
* `build_index(cfg, feature=...)`
* `add(cfg, items, feature=..., dry_run=False)`
* `remove(cfg, items, feature=..., dry_run=False)`
* `health(cfg)`

</details>

<details>

<summary>Full config reference</summary>

Config namespace:

* `cfg["plex"]` (fallback: `cfg["auth"]["plex"]`)

Fields:

* `token`, `baseurl`, `client_id`
* `server_name`, `machine_id`
* `username`, `account_id`, `home_pin`, `password`
* `timeout` (default: `10.0`)
* `max_retries` (default: `3`)
* `watchlist_allow_pms_fallback` (default: `true`)
* `watchlist_page_size` (default: `100`)

Dependencies:

* `requires: ['plexapi']`

</details>
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.crosswatch.app/blueprint-architecture/sync/_mod_plex.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
