Jump to content

Plekt: self-hosted watch history sync for Emby, Plex and Jellyfin


Recommended Posts

Lasikie
Posted

Hi everyone,

I’m the developer of Plekt, an open-source, self-hosted app that keeps watch history, watched status and playback progress in sync across Emby, Plex and Jellyfin. It can also sync with Trakt and Simkl.

home-dashboard.thumb.jpg.e96658093800931828425c01865ce719.jpg

Plekt stores its history locally in SQLite and runs in Docker. It can restore watch state when media is re-added or a library is rebuilt, and carry resume progress between servers.

The latest release, v2.2.0, adds official Emby and Jellyfin plugins for server events, multi-user accounts, Simkl sync, Netflix history imports and a Watch History Days view.

Website: https://plekt.net/
Setup documentation: https://plekt.net/docs/
Source code: https://github.com/Lasikiewicz/plekt
Release notes: https://github.com/Lasikiewicz/plekt/releases/tag/v2.2.0

Before connecting a real library, please make a backup and start with a limited provider scope.

Disclosure: I used AI coding agents during development, with manual review and testing. Plekt is licensed under AGPL-3.0 and is not affiliated with Emby, Plex, Jellyfin or Trakt.

Eigeplackter
Posted

Thanks for sharing, I like the look way more than crosswatch or watchstate.

Sadly I'm not able to get an intial sync.

The dashboard features the actual playback, but polling a sync throws:

 

Quote
[17:23:08] INFO    Operation started.
[17:23:08] INFO    [pull] Import Watched Status started for all media.
[17:23:08] INFO    Emby: querying played items...
[17:23:18] INFO    Emby ERROR: failed to fetch watched items: Upstream request timed out after 10000ms
[17:23:18] INFO    [pull] Import Watched Status finished: 0 items.
[17:23:18] SUCCESS Operation completed.

No matter if I use user/pass or api

Lasikie
Posted
26 minutes ago, Eigeplackter said:

Thanks for sharing, I like the look way more than crosswatch or watchstate.

Sadly I'm not able to get an intial sync.

The dashboard features the actual playback, but polling a sync throws:

 

No matter if I use user/pass or api

Thanks for sharing the log. The initial sync is timing out while Plekt queries Emby for played items; playback showing on the dashboard is a separate request, so it can work even when this library query times out.

Could you let me know roughly how large your Emby library is, and whether the Emby server is remote or under heavy load? Also, does a retry succeed, or does it time out consistently? Please share the Plekt version and any nearby server log entries from the same time, with credentials and tokens removed. That should help narrow down whether the delay is from Emby or the request timeout.
 

Eigeplackter
Posted

It times out consistently.

Emby (native) and Plekt (Docker) run on the same machine (Fedora Linux).

The db is about 500MB

There's no heavy load, was just me watching 1 episode.

v.2.2.0

embyserver-63928721706.txt

Posted (edited)
4 hours ago, Eigeplackter said:

It times out consistently.

Emby (native) and Plekt (Docker) run on the same machine (Fedora Linux).

The db is about 500MB

There's no heavy load, was just me watching 1 episode.

v.2.2.0

embyserver-63928721706.txt 88.49 kB · 0 downloads

Hi @Eigeplackter, thanks for the detailed report and especially the Emby debug log. It showed exactly what was going on.

What was wrong
On the first watched sync, Plekt asked Emby for your entire played history in a single request. On a large library that one response couldn't come back within Plekt's 10 second outbound timeout, so it failed every time. Every other request in your log answered in milliseconds.

The fix
Plekt now fetches watched history in pages of 500 items. It also asks Emby not to include artwork in those requests, because Plekt doesn't use artwork from this feed. Jellyfin got the same change.

How to test it
The fix is in the develop image: `ghcr.io/lasikiewicz/plekt:develop` (the numbered tag for this build is `develop-1`).

1. Change your image to `ghcr.io/lasikiewicz/plekt:develop` and pull it (`docker compose pull`, or `docker pull ghcr.io/lasikiewicz/plekt:develop`).
2. Recreate the container (`docker compose up -d`). Your data stays in the existing data volume.
3. Run the initial watched sync for Emby again.
4. Let me know if it completes, or if it still times out.

If you'd rather stay on the release image for now, there's a workaround: raise Outbound Request Timeout (sec) to 30-60 seconds under Settings > Sync tuning, or set the `OUTBOUND_TIMEOUT_SEC` environment variable to the same value. Once the fix is confirmed, you can switch back to `latest` when the next release is out.

A side note for the Emby New Overlay author
Your log also shows the third-party Emby New Overlay 1.2.0.0 plugin throwing an `ArgumentOutOfRangeException` from `NewBadgeEnhancer.GetConfigurationCacheKey` (26 times during that one request) while Emby built image tags. It throws for each item a client asks for with images, so it happens with other apps too, not just Plekt. Plekt now skips artwork for this request, but the plugin's author may want to look at it.
 

Edited by Lasikie

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...