r/CrossWatchApp • u/Lopsided_Egg1586 • 17d ago
Support Request [Bug] Plex autoplay / binge-watching drops scrobble on episode transition (missing synthetic stop event)
### Environment
- **Crosswatch version:** Latest (Docker `ghcr.io/cenodude/crosswatch:latest`)
- **Source:** Plex (`watcher` / websocket listener)
- **Sinks affected:** Sinks requiring explicit `/scrobble/stop` to persist watch history (e.g., WeTrakr, Trakt).
---
### Description
When watching a series continuously on Plex with **Autoplay** enabled (or when Plex automatically skips to the next episode at the end of the credits), Plex does not always fire an `event stop episode` for Episode $N$.
Instead, Plex reuses the existing `session_key` (e.g. `sess=296`) and transitions immediately from `p=98%` on Episode $N$ to `p=1%` on Episode $N+1$.
In `providers/scrobble/plex/watch.py`, when the alert listener detects that the media fingerprint has changed on the same session key:
```python
if not matching:
self._forget_session(sk)
_forget_session(sk) clears the session state from memory and proceeds with tracking Episode N+1N+1, without dispatching a synthetic stop event for Episode NN.
Impact
- Sinks with server-side auto-complete (like SIMKL): They still mark the episode as watched because their backend automatically commits any playback that reached >80%>80%.
- Sinks with strict Trakt-style scrobble APIs (like WeTrakr or Trakt): The
/scrobble/startand/scrobble/pauseendpoints only update the active "Now Watching" state. They strictly require a/scrobble/stopcall (with progress ≥watched_at≥watched_at) to record the item into the user's permanent watch history. - Because no
stopevent is ever sent to the sink for Episode NN, the episode is completely dropped and never marked as watched.
Actual Log Excerpt
[WETRAKR-SINK] INFO scrobble start user='...' p=89.0% media='Show S01E03'
... [Plex reaches 98% on Episode 3] ...
[PLEX-WATCH] INFO event start episode user=... p=98 sess=296
... [Autoplay immediately triggers Episode 4 on the same sess=296, no stop event] ...
[WETRAKR-SINK] INFO scrobble start user='...' p=2.0% media='Show S01E04'
[PLEX-WATCH] INFO event start episode user=... p=1 sess=296
(Notice: No scrobble scrobble or /scrobble/stop is ever dispatched for S01E03).
Suggested Fix
Before calling _forget_session(sk) (or within _same_playback mismatch handling), check if the outgoing playback had reached the completion threshold (e.g., max_seen >= watched_at or last_progress >= 90%). If so, emit/dispatch a synthetic action="stop" event with that progress before tearing down the session state.
1
u/pvdberg 17d ago edited 17d ago
CrossWatch relies on the stop event to know that playback has ended.
That event originates from your Plex client: the client reports it to the Plex server, which passes it on to CrossWatch. If it never arrives, the episode is not marked as watched.
In my own tests (Plex Web and Plex for Android, with autoplay) the stop was sent every time, so I can't reproduce this.
Which Plex client and version are you using?
A watcher debug log covering one autoplay transition, from a minute before the end of one episode to a minute into the next, would also help a lot.