Skip to content

Playback: leaving for the next episode marks the finished one watched - #969

Merged
GLinnik21 merged 5 commits into
plxnative:mainfrom
tiper:upstream/mark-watched-on-next
Oct 29, 2026
Merged

GLinnik21 merged 5 commits into
plxnative:mainfrom
tiper:upstream/mark-watched-on-next

Conversation

@tiper

@tiper tiper commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

A server only marks an item played itself when the stop lands past its own threshold and long credits start before that. Up Next and Skip on a final credits marker now set PlaybackSession::finished; the stop worker scrobbles the item after the stopped report, before the app reads the watch state back.

tiper and others added 5 commits October 24, 2026 01:55
A server only marks an item played itself when the stop lands past its own
threshold (Jellyfin's MaxResumePct, 90% by default), and long credits start
before that. Up Next and Skip on a final credits marker now set
PlaybackSession::finished; the stop worker scrobbles the item after the
stopped report, before the app reads the watch state back.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Conflicts in route/decision.rs and app/playback.rs resolved onto main's current structure: the session's start-refusal and engine-failure fields stay as main has them with `finished` added beside them; request_play_inner now delegates to request_play_with_queue, so the stale-flag reset moved into the latter (the one door every playback request passes); play_up_next sets `finished` before the shared queue_transport::play stop. The Jellyfin threshold wording in the field's doc is PMS's now.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A stop that finished the item (Up Next, Skip on a final credits marker) posts `stopped` and then the scrobble, and the record the app is told reads as the item's end; the next stop, which was not a finish, posts `stopped` alone. A flag no stop took is cleared by the next playback request.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… scrobbled again

Up Next also runs at the end of the stream and when its countdown expires, and
the final credits marker usually starts past 90 %, so the stop there already
makes PMS count the view; the extra /:/scrobble recorded a second one. The
scrobble now follows only a stop below the threshold, through viewstate's
existing WATCHED_PERCENT (now one predicate, past_watched_threshold, for the
offset clamp and this gate). The 59 s of 60 s case posts stopped alone; the
docs that said the stop alone commits the watched state say so no longer.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…e finish scrobble

The two stop tests set PlaybackSession::finished by hand, so deleting either
line that arms it in the app kept everything green. The flag is taken by the
stop it precedes, so the fixture server's request log is the observable: a
real Engine, then Up Next (below and past the threshold) and Skip on a final
credits marker with Next episode Off, each read off the stop's requests.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@GLinnik21
GLinnik21 merged commit 0e5cb47 into plxnative:main Oct 29, 2026
13 checks passed
@GLinnik21

Copy link
Copy Markdown
Collaborator

Merged, thank you! One change on top: the scrobble goes out only when the stop is below the server's 90% mark. Past it the server has already counted the play, and a second scrobble would add a second view.

@tiper
tiper deleted the upstream/mark-watched-on-next branch November 2, 2026 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants