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.

  • Like 1
  • Thanks 1
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

Lasikie
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
  • Thanks 1
Eigeplackter
Posted

@LasikieThanks, sync running with adapted parameter.

 

@LukeAfaik that‘s an official Emby plugin ? Maybe it‘s not made for actual stable and it‘s a residue as I was on beta before 4.11.0.10

  • Like 1
Lasikie
Posted
6 minutes ago, Eigeplackter said:

@LasikieThanks, sync running with adapted parameter.

 

@LukeAfaik that‘s an official Emby plugin ? Maybe it‘s not made for actual stable and it‘s a residue as I was on beta before 4.11.0.10

@Eigeplackter Great, thanks for letting me know. Could you post once the sync has finished, and say roughly how long it took?

If you have time afterwards, it would really help to test the actual fix as well, because the raised timeout only works around the problem:

  • Switch to ghcr.io/lasikiewicz/plekt:develop, pull it and recreate the container.
  • Set Outbound Request Timeout (sec) back to 10 (under Settings > Sync > Sync tuning), or remove OUTBOUND_TIMEOUT_SEC if you set it.
  • Go to Settings > Sync > Sync Tools, open Force Sync Options, and run Import Watched Status with Emby as the source. It reads your full watched history from Emby in the same way as the initial sync, but only adds watches Plekt doesn't already have. It never sends anything to Emby or removes anything, so it's safe to run again.

If that finishes without a timeout on your library, I'll know the fix works on large libraries and not just my test servers. No rush, and thanks again for the detailed logs.

Eigeplackter
Posted

Some observations:

 

Is it really necessary to sync every 30 seconds automatically ?

Quote
 
2026-10-27 21:45:37POLL[all:1]Scheduled Sync complete! Synced Plex: 0, Emby: 0, Jellyfin: 0, Library availability repairs: 0, Resume Plex: 0, Resume Emby: 0, Resume Jellyfin: 0, Next Up Emby: 0, Next Up Jellyfin: 0, Failed Up Next feeds retried: 0, Manual: 0
2026-10-27 21:46:18POLL[all:1]Scheduled Sync complete! Synced Plex: 0, Emby: 0, Jellyfin: 0, Library availability repairs: 0, Resume Plex: 0, Resume Emby: 0, Resume Jellyfin: 0, Next Up Emby: 0, Next Up Jellyfin: 0, Failed Up Next feeds retried: 0, Manual: 0

Polling for running playback sessions stops and immediately starts an new run. Might be an idea to give it a break once in a while.

A button for deactivating live updates while browsing the logs is much appreciated. View always jumps to the latest entry. Makes it hard to lookup an earlier log entry.

And even though there is only one media server configured so far, the log shows spam trying to push/pull data to an Plex instance. 
Gave up searching for exact message due to prior observation 😆

Filter options for logs could be helpful too.

Outbound shows all items listen twice and last action is „marked played“.

Quote
 
[2026-10-27T22:28:43.443Z] [SYNC] [all:1] Emby item marked unplayed { itemId: '1787031' }
[2026-10-27T22:28:43.444Z] [SYNC] [all:1] Emby item marked played { itemId: '1787031', datePlayed: '20260910161239' }

Image in Stats shows wrong show:

image.thumb.png.f9c0332531d38d78d1aea77cd2d49f9a.png

I don‘t even have Captain Planet 😜

Image is correct on detail page after click on the entry

image.thumb.png.3ca8698a04ee757984f054946223acc2.png


I see plenty of errors that an episode could not be matched to an tvdb entry. Is it possible that matching takes place only by english names ?

Enough for an evening, more tomorrow.

 

PS: Force sync still going after 45 minutes.

Lasikie
Posted

Thanks for the detailed feedback. I’ve added Pause/Resume, Follow latest and text filtering to Server Logs, alongside the scroll-position fix. I also corrected a Stats issue that could mix artwork between different shows with the same title. These changes aren’t in a published image yet.

I’ve reduced idle playback checks to once every five minutes, so Plekt makes fewer background requests when nothing is playing. Please set up the plugin or playback webhooks for prompt updates. Polling provides a fallback if an event is missed, then checks more frequently once playback is detected. These are small playback-session requests, not library scans.

To investigate the remaining reports, could you provide:

  • Now Playing: the exact stop/restart sequence, whether you restart playback or Plekt, how long the display stays wrong, and which plugin/webhook setup you use.
  • Plex messages: the exact log lines and timestamps, and whether any Plex connection is saved, even if disabled.
  • Duplicate outbound entries: one affected title/episode, both timestamps/actions and the destination shown.
  • Stats artwork: the title/year shown and which show’s artwork appeared.
  • TVDB matching: one failed show and episode, its TVDB series ID if available, and the exact unmatched message. Matching includes localized and translated names.

For the earlier timeout retest, please also confirm the image/build, timeout setting, exact Force Sync option, and whether it eventually completed, including total duration. The test we’re checking is the :develop image with the timeout back at 10 seconds, using Import Watched Status from Emby.

Please remove tokens, API keys and other private details from anything you share.

Eigeplackter
Posted (edited)

FYI: Force sync with stable and 120 OTS took 6hrs, 11pm to 5am.

1.

2. Plex messages, see attached log. No Plex connection is saved so far.

3. All entries ?

image.thumb.png.3e1aaa40341ef34d818e3288b2dccb5d.png

 

4.  LOL - Last One Laughing (Germany) 

- wrong artwork not listed on tvdb 

- plays in overview differs from details 45 <> 0

Overview

image.png.bd811976b64533c5204eaa04b275feeb.png

Details

image.png.ec3732a380d15b8616de456acad50c03.png

5. i.e. Alert Missing Persons Unit

Metadata was initially scraped by TinyMediaManager.org 

image.png.400f868b7c7bd0fce290a7f24088b2d5.png

image.png.a39b297d61f196aaac348f9ddbfd94e0.png

tvdb is configured as default provider

image.png.952f3280b5fe19da60dbc2df5aa023cc.png

 

 

Additionally:

Searching in Watch History is impossible, as site refreshes after every typed character.

i.e. trying to type "Will Trent" ends up searching "Willent" or "Wlr" depending on speed of typing

 

EDIT: Changed to develp 2.2.0.0.3 - force sync seems to work now.And back to 2.2.1.0

EDIT2: Upcoming seems to crash the app, as it loads upcomming episodes multiple times and in every language into the calendar view.

image.thumb.png.9d5f7a56f5ee94b9aa1c833093fe776e.png

Plex-Raw-Event-missing-payload-sync-2026-10-28T11-33-23-428Z.log

Edited by Eigeplackter
Lasikie
Posted
10 hours ago, Eigeplackter said:

FYI: Force sync with stable and 120 OTS took 6hrs, 11pm to 5am.

1.

2. Plex messages, see attached log. No Plex connection is saved so far.

3. All entries ?

image.thumb.png.3e1aaa40341ef34d818e3288b2dccb5d.png

 

4.  LOL - Last One Laughing (Germany) 

- wrong artwork not listed on tvdb 

- plays in overview differs from details 45 <> 0

Overview

image.png.bd811976b64533c5204eaa04b275feeb.png

Details

image.png.ec3732a380d15b8616de456acad50c03.png

5. i.e. Alert Missing Persons Unit

Metadata was initially scraped by TinyMediaManager.org 

image.png.400f868b7c7bd0fce290a7f24088b2d5.png

image.png.a39b297d61f196aaac348f9ddbfd94e0.png

tvdb is configured as default provider

image.png.952f3280b5fe19da60dbc2df5aa023cc.png

 

 

Additionally:

Searching in Watch History is impossible, as site refreshes after every typed character.

i.e. trying to type "Will Trent" ends up searching "Willent" or "Wlr" depending on speed of typing

 

EDIT: Changed to develp 2.2.0.0.3 - force sync seems to work now.And back to 2.2.1.0

EDIT2: Upcoming seems to crash the app, as it loads upcomming episodes multiple times and in every language into the calendar view.

image.thumb.png.9d5f7a56f5ee94b9aa1c833093fe776e.png

Plex-Raw-Event-missing-payload-sync-2026-10-28T11-33-23-428Z.log 4.21 MB · 1 download

Thanks for the thorough follow-up, and good to hear the develop build got Force Sync through. The paged read (500 items, no artwork) is in 2.2.1, so you're on that fix now. If you can, let me know how long a Force Sync takes on 2.2.1 with the timeout back at 10 seconds.

Most of what you found has a fix queued for the next hotfix (2.2.2). The items below are not in a published image yet.

- Watch History search: it no longer drops characters while you type (the "Will Trent" case).
- Plex messages with no Plex connection: this came from how Emby's multipart notifications were parsed. That is fixed.
- Duplicate outbound entries: I traced Emby item 1787031 (marked unplayed, then played one millisecond apart) to two opposing Force Sync writes for the same item. Force Sync now drops conflicting watched/unwatched pairs.
- Stats artwork: the same-title mix-up is fixed in 2.2.1. Stats cards now also open the show by id. Last One Laughing (Germany) opened the wrong record with 0 plays, which explains the 45 versus 0 you saw.
- TVDB matching: it is not English-only. Matching includes localized and translated names. The Alert: Missing Persons Unit failures came from Force Sync storing episode ids as show ids, so those episodes ended up as separate "shows". Force Sync now resolves the series id. I'm also adding a repair for rows that were already split. It takes a backup first, you approve it show by show, and every change can be undone.

What I still need from you:

1. The Emby item ids for the Last One Laughing series, plus which Force Sync option you ran on 27 October. The poster still points at another version, and I can't fix that without the ids.
2. Upcoming: I haven't reproduced this and don't have a fix for it yet. Which page were you on (Upcoming in the sidebar or the dashboard widget)? Which browser are you using? Is a metadata language set in Settings? A screenshot or a browser console error would help a lot.
3. Remove tokens and API keys before sharing any logs.

I'll post here when 2.2.2 is out.
 

Eigeplackter
Posted

Bonus questions:

Why does it spam my Emby logs with playback starts ?

 

1.jpg.a9b9961f46e1015c63c1597b599c5dc0.jpg

 

And whx is Plekt still browsable and actively logging, even after the docker container was stopped ?

image.thumb.png.eca869307f0a258a913add8cd26f5f9c.png

 

 

Lasikie
Posted
8 minutes ago, Eigeplackter said:

Bonus questions:

Why does it spam my Emby logs with playback starts ?

 

1.jpg.a9b9961f46e1015c63c1597b599c5dc0.jpg

 

And whx is Plekt still browsable and actively logging, even after the docker container was stopped ?

image.thumb.png.eca869307f0a258a913add8cd26f5f9c.png

 

 

Thanks, the screenshots help a lot.

1. Playback starts on "Plembfin Up Next": that is Plekt's Up Next sync. For each show whose next episode changed, Plekt opens and immediately closes a zero-position playback session in Emby. This makes Emby recalculate Continue Watching so the next episode shows up there. Plekt then restores the play count, watched flag and position, and ignores that device so it never counts as playback. Many shows at 23:14 means a lot of Up Next entries changed at once, for example after a Force Sync or an image switch. If you don't want Plekt touching Emby's Continue Watching, turn off "Sync Up Next to media apps" in Sync Tuning. Plekt's own Up Next view keeps working either way.

2. Logging after the container stopped: your terminal shows the shutdown (SIGTERM, then forced exit), so Plekt did stop. The red "Failed to fetch" lines come from the Plekt page still open in your browser. It keeps polling and logging its own errors until the tab is closed or refreshed. Nothing on the server was still running.

One more check for the duplicate outbound entries: in your Emby activity log around 22:28 UTC on 27 October, is there a "Plembfin Up Next" start/stop for the episode right after item 1787031? That tells me whether the unplayed/played pair came from Force Sync or from the Up Next refresh.
 

Eigeplackter
Posted (edited)
18 minutes ago, Lasikie said:

....

What I still need from you:

1. The Emby item ids for the Last One Laughing series, plus which Force Sync option you ran on 27 October. The poster still points at another version, and I can't fix that without the ids.
2. Upcoming: I haven't reproduced this and don't have a fix for it yet. Which page were you on (Upcoming in the sidebar or the dashboard widget)? Which browser are you using? Is a metadata language set in Settings? A screenshot or a browser console error would help a lot.
3. Remove tokens and API keys before sharing any logs.

I'll post here when 2.2.2 is out.
 

1.

Show tvdbID 400263 & episodes:

S01-E01 8321590

S01-E02 8321591

image.png.86e85f4539171f22d0bc97db3aa90322.png

2.

I'm on Win11 using Chrome Version 156.0.8078.74 & used Upcoming on the sidebar

image.thumb.png.37b8ff676eb3f849d59d70b8a81b7aac.png

Maybe I'm missing it, but there's no option to pick a language under Settings -> Metadata

image.thumb.png.fecac2c1f27967d7673ffa0f0f42eda9.png

8 minutes ago, Lasikie said:

Thanks, the screenshots help a lot.

...

2. Logging after the container stopped: your terminal shows the shutdown (SIGTERM, then forced exit), so Plekt did stop. The red "Failed to fetch" lines come from the Plekt page still open in your browser. It keeps polling and logging its own errors until the tab is closed or refreshed. Nothing on the server was still running.

One more check for the duplicate outbound entries: in your Emby activity log around 22:28 UTC on 27 October, is there a "Plembfin Up Next" start/stop for the episode right after item 1787031? That tells me whether the unplayed/played pair came from Force Sync or from the Up Next refresh.
 

2. I'm still wondering how it is polling/logging and the whole site being browsable, even though the container was shut down.

Sorry, I deleted the logs after upgrading to v2.2.1.0

 

Edited by Eigeplackter
Eigeplackter
Posted

Sometimes Plekt misses played episodes, when marked manually.

image.png.a17415ded8f9526951a4c766b420a775.png

image.thumb.png.8e518a9fba30fcef6db3dab7f9ed4705.png

image.thumb.png.341cd0d2c4668a126dd4b56b1a5f1279.png

Plekt is set to the following option:

image.png.699b170759cee5a9b38638792c0c722b.png

Eigeplackter
Posted

Oh and the same Force Sync took 4 Mins w/o problems and around 22000 items.

Lasikie
Posted

Thanks! Four minutes for around 22,000 items sounds much better.

I’ve pushed a develop build with fixes for several of the issues you reported. If you’re happy to test it, please make a backup under Settings > Backup first. This is a testing build, not the stable release.

In your Docker Compose file, change the Plekt image to:

ghcr.io/lasikiewicz/plekt:develop

Then run:

docker compose pull
docker compose up -d

Keep your existing volume mapping, then hard-refresh Plekt in your browser.

Could you try these checks?

1. Missed manual marks

- Open Settings > Webhooks and expand the Emby guide.
- Click Test beside your configured plugin or webhook, then press Start test.
- In Emby, mark an unwatched episode played using the account connected to Plekt.
- If the test passes, choose “Yes, remove it from Emby” to undo the test mark.
- If it fails, please share the result shown.

The test mark isn’t added to Plekt’s history or sent to your other services.

2. Upcoming and search

- Open Upcoming from the sidebar. Does it load without crashing or repeating episodes?
- In Watch History, can you type “Will Trent” without characters being lost?

3. LOL and Alert

- Click the LOL Stats card. Does it open the show with the correct play history? The poster may still need investigation.
- For Alert, open “Repair Split Episode Shows” under Settings > Tools and run the audit.
- Please share what the audit proposes before applying a repair. The tool creates a backup and provides undo.

4. Logs

- Do you still see “Plex Raw Event: missing payload”?
- Do you still see the same Emby item marked unplayed and played together?

The build fixes the multipart parsing and one possible cause of conflicting writes.

A few details would help with the remaining investigation:

- For LOL, could you share Emby’s item IDs for the series and affected episodes? The IDs you supplied were TVDB IDs.
- For the four-minute sync, was the timeout set to 10 seconds, and which Force Sync option did you run? Do you remember which option produced the earlier duplicate actions?
- For the playback issue, what did you stop and restart, and how long did the display stay wrong? Were you using the Plekt plugin or Emby’s built-in webhook?
- With the container stopped, does Plekt still load after a hard browser refresh?

Please remove tokens, API keys and other private details from any logs or screenshots. Thanks again for helping test this!
 

Eigeplackter
Posted

Sorry, ain't got the time, might come back next year to see how it's going.

GJ so far.

 

Lasikie
Posted
40 minutes ago, Eigeplackter said:

Sorry, ain't got the time, might come back next year to see how it's going.

GJ so far.

 

No problem at all, and thank you. I know I asked a lot of you, and I really appreciate the time you've already put in. Your reports were clear and detailed, and they led to real improvements in Plekt.

Glad you've found it useful so far. If you do come back next year, you're always welcome, and if anything comes up in the meantime you know where to find me.

Thanks again for the excellent feedback!

Lasikie
Posted

Hi all,

v2.2.4 of Plekt is out. It lets you pick a different episode order for each show, so watch history from your server lands on the right episodes.

- Episode order per show: choose Aired, DVD or any other order TVDB lists from the show's Episode order menu. Imports and live sessions from Emby are translated to that order before they are saved.
- DVD links: review, save and remove DVD-to-aired episode links from the show menu.
- Force Sync: library replay is faster, and Emby scans use cheaper paging.
- Download logs: pick a time range on the Logs screen, from the last hour up to all kept logs.

Also fixed: Trakt double writes, plus several sync, restore and sign-in gaps.

One thing to know: a show using a non-Aired order is not sent to Simkl, because Simkl cannot confirm those episodes. Emby, Jellyfin, Plex and Trakt still receive them.

Release notes: https://github.com/Lasikiewicz/plekt/releases/tag/v2.2.4
 

  • Thanks 1
Lasikie
Posted

Plekt v2.3.0 is out. It improves how alternate episode orders are tracked and makes sync safer when a server returns an incomplete read.

• Alternate-order episode watches no longer become unwatched when Plex, Emby or Jellyfin background checks inspect a different episode.
• Plex Web watched and unwatched changes are picked up more reliably, including bursts of manual watches.
• Import Watched Status checks every episode before saving and keeps episodes distinct when servers use different orders.
• Manual Watch Review matches episode names to stored numbering and labels verified alternate-order watches with aired episode numbers.
• The Docker image is about half the size.

Also fixed: Force Sync no longer removes a Trakt play without adding it back, and clearing a resume position on Plex, Emby or Jellyfin clears it on the other servers, even when Plex misses the notification.

One thing to know: older uncertain watches appear in Manual Watch Review for an administrator to confirm after a local backup is verified. Nothing is repaired automatically.

Release notes: https://github.com/Lasikiewicz/plekt/releases/tag/v2.3.0
 

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...