> For the complete documentation index, see [llms.txt](https://wiki.crosswatch.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.crosswatch.app/blueprint-architecture/sync/_mod_emby/history.md).

# history

Related:

* Engine semantics: [History (engine-level)](/blueprint-architecture/sync/engine-level-features/history.md)
* Setup: [Adapter: Emby](/crosswatch/providers/synchronization/adapter-emby.md)

{% tabs %}
{% tab title="End users" %}

### What syncs

This feature syncs **watched state**.

On Emby, that maps to “played” per user.

### Supported media types

Commonly:

* Movies: ✅
* Episodes: ✅

Other types depend on how Emby reports IDs and user data.

### Reads vs writes

* Reads: build a present-state index of what Emby considers watched.
* Writes:
  * `add` marks an item played.
  * `remove` unmarks an item played (when enabled for the pair).

### Key settings

* `emby.history.libraries`: optional library whitelist
* `emby.history.history_query_limit`: limits read size
* `emby.history.history_write_delay_ms`: pacing between writes

Config reference: [Configuration (config.json)](/crosswatch/configuration-config-json.md).

Library scoping: [Library Whitelisting](/crosswatch/library-whitelisting.md).

### Known limitations

* Emby writes can take a moment to show up in reads.
* Missing external IDs makes “same item” detection harder.

### Troubleshooting

**History updates repeat every run**

* Index matching is failing due to missing IDs.
* Or Emby is slow to reflect recent writes.

Fix:

* improve external IDs
* add a small write delay
* keep history remove disabled until stable
  {% endtab %}

{% tab title="Power users" %}

### Code map

* `providers/emby/_history.py`
* `providers/emby/_common.py`

### State files

* `emby_history.shadow.json` (write-through memory)
* `emby_history.unresolved.json`
* `emby_history.emby.blackbox.json` (flap suppression)

Related:

* [Blackbox](/blueprint-architecture/orchestrator/blackbox.md)
* [Unresolved](/blueprint-architecture/orchestrator/unresolved.md)

### Debugging

* `CW_EMBY_DEBUG=1` adds provider-level debug logs.
  {% endtab %}
  {% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://wiki.crosswatch.app/blueprint-architecture/sync/_mod_emby/history.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
