Skip to content

fix(audiobooks): track Audiobookshelf plays accurately in admin sessions and history - #3108

Merged
Quick104 merged 17 commits into
Silo-Server:mainfrom
Brady3035:abs-playback-tracking
Nov 15, 2026
Merged

Quick104 merged 17 commits into
Silo-Server:mainfrom
Brady3035:abs-playback-tracking

Conversation

@Brady3035

@Brady3035 Brady3035 commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Closes #3098
Closes #3099
Related issue: N/A
Validation tasks: none

Admins can't trust what Activity and Playback History show for Audiobookshelf-compatible plays, in three ways:

This change measures plays against the whole book, applies the close's final sync, and counts the listening time clients report.

Plays that apps report only through /session/local (Plappa, Prologue) still don't appear in Activity or Playback History; #4244 tracks that. An earlier version of this PR tracked them, and the maintainer review took that part out (see Risks).

Approach

  • Book length. The ABS play start records the book's total length on the native playback session, as Session.TimelineDuration, because ABS positions are in the whole book while the session runs on the first file. Playback History uses it. Activity reads playback_sessions_sync, so a migration adds a nullable timeline_duration_seconds column, and the live query prefers it to the file's duration.
  • Close. A close with a body applies it like a PATCH /session/{sid} sync before closing, as Audiobookshelf does. This is best effort: a body that can't be read, or a sync that fails, still closes the session, and a session that is already closed applies nothing.
  • Time spent. Sessions credit the listening the client reports instead of inferring it from position:
    • Session syncs carry timeListened, the seconds since the previous sync. The ABS session row keeps the running total, and the native session credits how far that total rose past the highest one it saw, so a sync another server handled still counts and a late or repeated one counts nothing. A client that never sends listening time is measured from its position, as before.
    • Each report is capped at the time that actually passed plus 2 seconds, so a client can't claim more. This also counts listening above 2× speed, which the position-based check took for seeks.
  • Client names. The deviceInfo clients send with /play names the session, so Activity shows "AudioBooth iOS 1.12" instead of "Audiobookshelf".

No API shape changes. For these sessions, file_duration on the admin and household session reads now carries the book's length, and its OpenAPI description says so. jellycompat doesn't change. The Apple and Android clients use the native API, so they need no change.

Validation

  • Go: build and gofmt are clean, go vet on the changed packages is clean, and lint-changed (golangci-lint v2.12.2) reports 0 issues.
  • Go tests: internal/playback, internal/audiobooks/..., internal/worker, internal/apiv2, internal/api/handlers and cmd/silo pass. New tests cover the book length in a history row, the close's final sync (including an unreadable body, an already-closed session and a close on another server), and crediting reported listening and its caps.
  • Contracts: the OpenAPI document and the web's generated types were regenerated for the file_duration description. The web tests and verify-apiv2-contract were not run; the web change is a generated comment.
  • Migrations: goose validate and migrationcheck pass. verify-local-paths passes.
  • Maintainer review (9d371b0, dcdec18): current main merged in; a close on another server now keeps the book length and final sync in history; /play syncs credit the session's running listening total, so a sync handled by another server still counts; tracking of local-session-only plays moved to Track Audiobookshelf plays that apps report only through local sessions #4244.
  • Not run: the full make test-go and the Postgres DB-contract tests, since there was no local database. The migration ran on a test server with existing sessions and history.
  • Manual, on a test server with a book split into 18 files: AudioBooth iOS 1.12 played past the first track, scrubbed and stopped. It showed in Activity under its own name with the book's length and left a Partial history row measured against 5 h 30 m. In an earlier run, history recorded 103.7 s for about 100 s of listening around a scrub; the client's own reports summed to 103.7 s.
  • Dev sandbox, dcdec18: a scripted ABS client on a 3-file book (15:00) resumed at 7:12, synced every 10 s for a minute and closed with a final sync. Activity showed 7:32 / 15:00 and history 1m 5s of 15m 0s, Partial. On main, the same steps show 7:32 / 5:00 and 1m 0s of 5m 0s, Completed.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-server/pr-3108/

Surface and build: web admin Activity and Playback History at desktop width, on a dev sandbox. Before is feae205b (main); after is this branch at dcdec189. The pairs show Activity during an ABS play and Playback History after it closes.

Risks

  • Migration. It adds one nullable column to playback_sessions_sync; the down migration drops it. Rows written before it read as the file's duration, as today.
  • Trusting reported listening. Time spent now comes from the client's reported listening wherever a client sends it. The cap limits it to the real time between reports, so a client can overstate its listening but never claim more than the elapsed time.
  • Local-session-only plays. The earlier tracking of plays that apps report only through /session/local kept them in one server's memory, outside the playback lifecycle. A play that resumed after its 90-second idle expiry was hidden from Activity for up to 25 hours, a server dying mid-play lost its history row, and servers could hold competing copies. It was removed in dcdec18; Track Audiobookshelf plays that apps report only through local sessions #4244 rebuilds it on the lifecycle path.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
  • The Evidence section shows every change a user can see, or says there is none.

AI Disclosure

  • Harness: Claude Code
  • Tool(s): Claude Code
  • Model(s): claude-opus-5-5
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: A separate Claude Code review agent (/code-review, high effort) reviewed the branch diff against main for correctness in two passes. The first pass found ten issues. The main ones were time spent over-counted after an idle expiry and not counted above 2× speed, the live view still using the first file's length, closes that failed on a bad body, and report-only plays taking stream slots. All were fixed except two: dependence on the device clock, recorded above under Risks, and sharing the sync handler's access check, which would have merged its separate 403 and 404 responses. The second pass found ten more. The main ones were no time counted for clients that send no listening total, an empty close body syncing position 0, out-of-order reports counting listening twice, and the undocumented change to file_duration. All were fixed except two: plays first seen mid-play, recorded above under Risks, and folding the duration check into the existing snapshot comparison, which a linter flags. The device-clock and mid-play risks left with the local-session tracking. A maintainer review of df5b940 (Claude Code, claude-opus-5-5, with a cross-check by Codex gpt-6.1-sol) found the multi-server close and listening-time gaps, fixed in 9d371b0, and the local-session tracking problems that led to its removal in dcdec18.

Note

Fix Audiobookshelf play tracking with book timeline durations and final sync data

  • Tracks whole-book timeline duration (sum of media-file durations) separately from per-file duration, so multi-file audiobooks are measured and marked complete correctly. This flows from ABS session start (native_sessions.go) through admin sessions, history entries, household profiles, and the worker session sync (reconciler.go).
  • ABS sync payloads now carry a listening-time total, and watch time is credited from increases in the highest reported total (capped at elapsed time plus slack) instead of inferred from position deltas. Stale or lower totals do not lower the baseline.
  • Session close accepts an optional final-sync body with currentTime. Final position and listening time are applied atomically in the close SQL, and the final sync is mirrored only when this call actually closed the session. Repeated or concurrent closes report false.
  • Adds migration 20261026180735_playback_session_timeline_duration.sql, a nullable timeline_duration_seconds column on playback_sessions_sync.
  • Risk: ClosePlaybackSession in abs_playback_session_store.go changes the ABSPlaybackSessionStore interface signature (final-sync data plus a boolean return). Sync listening-time deltas are clamped to 0–1 day in syncPayload.timeDelta, and admin history entries switch to timeline duration when positive, changing reported durations for multi-file books.

Macroscope summarized dcdec18.

Brady3035 and others added 10 commits October 26, 2026 13:41
…in admin history

An Audiobookshelf play mirrors into a native playback session started on
the book's first file, while its syncs report the position in the whole
book. Admin Playback History took the first file's length as the
duration, so a multi-file book was marked completed once the listener
passed the end of the first track. The ABS play start now records the
book's total length on the session, and the history row uses it.

Closes Silo-Server#3098

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… carries

Audiobookshelf clients send their last position and listening time in
the body of POST /session/{sid}/close, and Audiobookshelf applies it as
a final sync before closing. Silo ignored the body, so everything after
the last periodic sync was lost from the resume position, the session's
listening time and the admin Playback History row written at close. A
close with a body now applies it like a sync first; an empty body still
closes without one.

Closes Silo-Server#3099

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… through local sessions

Some Audiobookshelf clients, Plappa and Prologue on iOS among them, never
open a session with /play. They stream the files directly and post their
local session to /session/local or /session/local-all every few seconds
while playing. Silo kept the resume position from those posts, but the
play never appeared in admin live sessions or Playback History.

A local session updated within the last two minutes is now mirrored into
a native playback session, as a /play session is. Its ID is derived from
the account, profile and client session ID, so every report of one play
reaches the same session and history row. It carries the book's length
and the client name from deviceInfo. These clients send no stop, so the
session takes its own 90-second idle window: the play ends 90 seconds
after the last report. Older reports (offline listening synced late, or
an old session sent again) still only move the resume position.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…, and name their clients

An Audiobookshelf session sync carries timeListened, the seconds played
since the previous sync. Admin watch time instead inferred playing from
how far the position moved, which drops a whole sync interval whenever it
contains a seek and the first interval when a client resumes from its own
saved position. With AudioBooth, a 2.5-minute listen around a scrub was
recorded as 1:43. A sync's timeListened is now credited directly, capped
at the time that actually passed so a client cannot claim more.

Sessions started with /play were also all named "Audiobookshelf". The
deviceInfo clients send in the /play body now names them, as it already
does for local sessions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…eport

A play reported only through /session/local was measured from its first
report, so the stretch before it (ten seconds with Plappa) was never
counted. The native session now starts measuring at the startTime and
startedAt the client reports, and the usual seek check still decides
whether that stretch was played.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…sions

The live sessions view measured an Audiobookshelf play's whole-book
position against the session's first file, so a book whose first track
is 44 seconds showed 57:09 / 0:43. The session's timeline length now
syncs to playback_sessions_sync, and the view uses it in place of the
file's duration when it is set.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Local-session plays credit the change in the client's running
  listening total, capped at the time that passed, instead of inferring
  it from position. Listening above 2x speed now counts.
- A play is measured from the client's start only when it began moments
  ago. A session rebuilt for an older play takes the client's total as
  its baseline, so a later skip is not credited.
- Local-session plays are report-only and never count toward stream
  limits: the client may be playing a downloaded copy.
- A close's final sync is best effort, so a body that cannot be read or
  a sync that fails still closes the session; a session already closed
  applies no final sync.
- A local-all batch syncs the admin views once, deviceInfo without a
  version keeps the header's version, and the book-length sum is shared.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
file_duration is the length position_seconds is measured against. For
a multi-file Audiobookshelf book that is now the whole book rather than
the session's first file, so the field's description says so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…cking

- A local session that reports no listening total is measured from its
  position again, instead of counting nothing.
- Only the highest listening total a session has seen is its baseline,
  so a late or repeated report cannot count the same listening twice.
- A close body without a currentTime ({}, null) is no final sync rather
  than a sync to position 0.
- A final sync that fails on the session row still writes the resume
  position and the native session's position.
- When deviceInfo names the client, the version comes only from it.
- A live report looks its session up once, and whether it started one
  is returned beside the ABS result instead of stored on it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-triage silo-triage Bot added the size/XL 500–999 added + deleted lines (all files); change volume, not priority. label Oct 26, 2026
@silo-kody

silo-kody Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review.

Walkthrough

This change tracks Audiobookshelf listening reports in native playback sessions, applies valid final sync data when sessions close, and stores whole-book timeline duration. Playback-session responses and admin history use that duration when available.

Changes: Audiobookshelf playback and duration

Layer / File(s) Summary
Playback progress and session lifecycle
internal/playback/session.go, internal/playback/watch_time.go, internal/playback/session_activity.go, internal/playback/*_test.go
Playback sessions support reported listening credit, report-only registration, per-session idle grace, and timeline duration. Watch-time accounting accepts reported listening values.
Audiobookshelf playback report tracking
internal/audiobooks/abs/native_sessions.go, internal/audiobooks/abs/session_local.go, internal/audiobooks/abs/play_response.go, internal/audiobooks/abs/*_test.go
Recent local-session reports update or register report-only native sessions. Play-start requests can provide device metadata. Handlers sync native sessions when playback starts.
Sync processing and session close
internal/audiobooks/abs/progress.go, internal/audiobooks/abs_playback_session_store.go, internal/audiobooks/abs/*_test.go
Session sync updates the playback session before mirroring progress and events. A valid final sync is applied atomically on close when the session closes and the caller can access the audiobook.
Timeline duration persistence and reporting
migrations/sql/20261026180735_playback_session_timeline_duration.sql, internal/worker/reconciler.go, cmd/silo/session_sync.go, internal/api/handlers/playback*.go, internal/apiv2/*.go, contracts/api/v2/openapi.json, web/src/api/v2/schema.ts
The whole-book timeline duration is persisted and included in session snapshots. Playback-session projections and admin history use the measured duration when available. API descriptions specify the duration basis.

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant ABSClient
  participant SessionCloseHandler
  participant ABSPlaybackSessionStore
  participant mirrorSessionSync
  participant PlaybackSessionManager
  ABSClient->>SessionCloseHandler: Submit close request with final sync
  SessionCloseHandler->>ABSPlaybackSessionStore: Close session and apply final position and listening time
  ABSPlaybackSessionStore-->>SessionCloseHandler: Return whether the session closed
  SessionCloseHandler->>mirrorSessionSync: Mirror final sync when the close succeeds
  mirrorSessionSync->>PlaybackSessionManager: Update native playback progress
Loading

Possibly related issues

  • Issue 666: This change adds idle expiry for report-only sessions, but does not address the issue’s native transcode and byte-flow liveness path.
  • Issue 1253: The change covers server-side progress, resume, and history behavior within the broader Audiobooks certification objectives.
  • Issue 1254: The change updates server-side progress and history behavior covered by some of the listed server validation cases.
  • Issue 1255: The change updates admin Playback History duration, completion, and final progress recording covered by some web-admin validation cases.
  • Issue 1256: The change updates server-side resume progress and history that the web client displays, but does not address web-side validation.

Suggested labels: javascript, api-v2, impact: playback

Suggested reviewers: quick104

Merge Risk: Minimal · up to eb9b8

No actionable issue remains from the reviewed changes; the reported close-session test expression does not block the Go build.

Security architecture risk: Moderate · up to eb9b8

Account and book-access checks remain in place. However, the new tracking sessions need stronger assurance that they cannot authorize actual streams, and a server interruption can leave their playback history unfinished.

Retained concerns

  • Medium · security · inferred: New report-only sessions bypass stream admission but enter the registry used by media-serving lookup. Registration leaves RequireMediaAuthorization unset, and the inspected live-session lookup does not reject ReportOnly entries before accepting them. Downstream routing or recipe checks may prevent actual serving, but that separation was not established. This is an unresolved authority boundary, not a verified streaming bypass.
  • Medium · reliability · inferred: The new report-only lifecycle has no durable start announcement. If its owning process fails before local expiry finalizes history, shared activity cleanup deletes the stale session row while the inspected recovery sweep searches only durable lifecycle rows. This leaves the newly introduced tracking path without equivalent crash-recovery ownership; local reports had no native history tracking before this PR.
Security review details

Security Blast Radius

  • inferred — The demonstrated new write scope is an authenticated account's reports about accessible audiobooks, affecting native tracking, shared activity, and history. Cross-user mutation was not established. The unresolved serving-authority question concerns whether those tracking entries can also consume real media-serving resources without normal admission.

Security Findings and Attack Paths

  • inferred — A candidate path is authenticated local report to admission-exempt native entry to media-serving session lookup. The producer and lookup acceptance are evidenced, but successful byte serving through downstream route and recipe controls remains unverified. This assessment does not establish an exploitable stream-limit or authorization bypass.

Trust Boundaries and Controls

  • observed — The local-report routes remain under bearer authentication in both base and head, with additional handler identity checks. Reported listening updates are mutex-protected, credit only increases in cumulative totals, and cap credited samples against elapsed time plus reporting slack.

Resilience and Maintainability Implications

  • inferred — Normal local expiry has a finalization path, but process failure removes that owner before it runs. Without a durable report-only lifecycle start, the inspected stale-row cleanup and lifecycle sweep do not provide equivalent recovery of the play's final history.

Hardening Proposals

  • proposed — Make report-only observations explicitly non-serving, either through a separate registry/type or comprehensive serving-entrypoint rejection, unless equivalent downstream enforcement is demonstrated. Give their history lifecycle a durable recovery owner as well.
Pre-merge checks: Passed 2 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Linked Issues check Warning [#3098] The diff stores a whole-book timeline duration and uses it for history completion and session duration reads. [#3099] The close handler reads a non-empty final sync, applies position and liste… Replace closedAt = new(time.Now()) with a valid *time.Time assignment. Run the affected Go tests.
Out of Scope Changes check Warning The direct linked issues cover whole-book duration and final synchronization for Audiobookshelf session close. The PR also adds local-session mirroring, report-only native sessions, idle-grace and acc… Move the local-session, report-only-session, listening-accounting, idle-window, device-name, and stream-limit changes to a separate pull request, or link active issues that require these objectives.
Passed Passed checks: 2 passed

Check name Status Explanation
Title check Passed The title clearly summarizes the primary change: accurate Audiobookshelf play tracking in admin sessions and history.
Description check Passed The description states the problem (multi-file books measured against the first file, close body final sync dropped, listening time inferred from position), the approach (timeline duration, migration,…
Full details: Description check

Explanation

The description states the problem (multi-file books measured against the first file, close body final sync dropped, listening time inferred from position), the approach (timeline duration, migration, final sync on close, client-reported listening time, deviceInfo naming), and validation steps. It matches the changeset, which implements exactly these items across the Go, migration, OpenAPI, and web files.

Full details: Linked Issues check

Explanation

[#3098] The diff stores a whole-book timeline duration and uses it for history completion and session duration reads. [#3099] The close handler reads a non-empty final sync, applies position and listening time before closing, and skips empty or unreadable bodies. However, internal/audiobooks/abs/native_sessions_test.go does not compile at closedAt = new(time.Now()); new requires a type, not a time.Time expression. The affected automated tests cannot run.

Resolution

Replace closedAt = new(time.Now()) with a valid *time.Time assignment. Run the affected Go tests.

Full details: Out of Scope Changes check

Explanation

The direct linked issues cover whole-book duration and final synchronization for Audiobookshelf session close. The PR also adds local-session mirroring, report-only native sessions, idle-grace and account limits, client-reported listening accounting, device-name propagation, and stream-limit behavior. These changes are not required by #3098 or #3099.

Resolution

Move the local-session, report-only-session, listening-accounting, idle-window, device-name, and stream-limit changes to a separate pull request, or link active issues that require these objectives.

Finishing Touches

Fix failing CI checks

  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5ebe6dce-d340-4cdb-9167-91b09e297943
Commits

Reviewing files that changed from the base of the PR and between 828128e and eb9b86b.

Files selected for processing: 11

  • contracts/api/v2/openapi.json
  • internal/api/handlers/playback.go
  • internal/api/handlers/playback_sessions.go
  • internal/api/handlers/playback_test.go
  • internal/apiv2/admin_sessions.go
  • internal/audiobooks/abs/native_sessions.go
  • internal/audiobooks/abs/progress.go
  • internal/playback/session.go
  • internal/playback/session_activity.go
  • internal/worker/reconciler.go
  • web/src/api/v2/schema.ts
Files skipped from review as they are similar to previous changes: 1

  • web/src/api/v2/schema.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@silo-triage silo-triage Bot added bug Something isn't working go Pull requests that update go code priority: P2 Limited scope, workaround exists, or polish labels Oct 26, 2026
@coderabbitai coderabbitai Bot added api-v2 API v2 / Huma migration program (epic #135); long-running, stacked by phase impact: playback Can't play, stalls, or wrong media javascript Pull requests that update javascript code labels Oct 26, 2026
Comment on lines +242 to +243
h.deps.NativeSessions.RegisterReconstructed(native)
return true

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Security high

Unbounded session-map growth occurs because RegisterReconstructed admits every distinct local-session ID without admission checks, while ReportOnly excludes these entries from stream limits; an authenticated user with access to one audiobook can repeatedly submit fresh IDs and current updatedAt values to accumulate arbitrarily many live entries, consuming memory and amplifying full-session synchronization and database reconciliation. Enforce a separate per-principal cap for report-only sessions atomically with registration.

Prompt for LLM

File internal/audiobooks/abs/native_sessions.go:

Line 242 to 243:

Unbounded session-map growth occurs because RegisterReconstructed admits every distinct local-session ID without admission checks, while ReportOnly excludes these entries from stream limits; an authenticated user with access to one audiobook can repeatedly submit fresh IDs and current updatedAt values to accumulate arbitrarily many live entries, consuming memory and amplifying full-session synchronization and database reconciliation. Enforce a separate per-principal cap for report-only sessions atomically with registration.

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed: report-only sessions are outside stream limits, so nothing capped them. Fixed in 7ed5167. SessionManager.RegisterReportOnly counts the account's live report-only sessions and registers the new one only while there are fewer than ten. The check and the insert happen under the manager's lock, so they're atomic. A report over the cap still saves the resume position; the play just isn't tracked. A session already live under the same derived ID always gets its update, so a cap reached later never cuts off a play already being tracked. These sessions also end 90 s after their last report, so a client can't keep a slot without reporting.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix you describe in 7ed51674b addresses the original concern: the atomic per-account cap bounds live report-only sessions without consuming stream slots, while existing sessions keep receiving updates and rejected registrations still preserve resume progress.

The 90-second idle expiry also releases inactive slots. Based on that description, this resolves the reported unbounded live-session growth.

Comment on lines +237 to +240
if began, ok := sess.beganRecently(now); ok {
native.StartedAt = began
} else {
native.ReportedListening = sess.TimeListening

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Bug medium

Listening-time undercount occurs because new local sessions without a positive timeListening never seed Watch from startTime and startedAt, so the first UpdateProgressReported call initializes Observe at the current position and omits prior listening. Initialize the watch baseline from the reported start position and recent start timestamp so the supported position-only fallback retains the first interval.

if began, ok := sess.beganRecently(now); ok {
		native.StartedAt = began
		native.Watch.Observe(sess.StartTime, false, began)
	} else {
		native.ReportedListening = sess.TimeListening
	}
Prompt for LLM

File internal/audiobooks/abs/native_sessions.go:

Line 237 to 240:

Listening-time undercount occurs because new local sessions without a positive timeListening never seed Watch from startTime and startedAt, so the first UpdateProgressReported call initializes Observe at the current position and omits prior listening. Initialize the watch baseline from the reported start position and recent start timestamp so the supported position-only fallback retains the first interval.

Suggested Code:

if began, ok := sess.beganRecently(now); ok {
		native.StartedAt = began
		native.Watch.Observe(sess.StartTime, false, began)
	} else {
		native.ReportedListening = sess.TimeListening
	}

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Fixed in 7ed5167, as suggested. When the client says the play began within the last two minutes, the new session's watch time is started at the reported startTime and startedAt. A client that sends no timeListening now gets the stretch before its first report counted by the normal seek check. Clients that send a total are unaffected, since crediting the total already used startedAt as the start. Added a "new play without a total" test case.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks—based on your description, 7ed5167 addresses this finding. Seeding the watch baseline from startTime and startedAt preserves the first interval for position-only clients while leaving reported-total accounting unchanged.

The “new play without a total” test covers the reported regression. No further change is needed for this suggestion.

Comment thread internal/audiobooks/abs/progress.go Outdated
// The final sync needs the same item access a periodic one does, and
// none applies to a session already closed: a repeated close must not
// send its stale position to the user's other clients.
if final != nil && sess.ClosedAt == nil && h.audiobookVisible(r.Context(), a, sess.ContentID) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Kody Rules high

Finalization data loss and a race condition arise from the ClosedAt snapshot check: it discards a later close with a further final position that could improve the same play's listening time and history, yet lets concurrent closes both observe an open session and apply final syncs before either closes it. Use a serialized, session-ID-keyed finalization operation that rejects duplicate or stale submissions, accepts legitimate advances, and updates resume/native playback state only for the accepted finalization.

Kody rule violation: Make playback finalization monotonic and consume dispatch state only after success

Prompt for LLM

File internal/audiobooks/abs/progress.go:

Line 441:

Finalization data loss and a race condition arise from the ClosedAt snapshot check: it discards a later close with a further final position that could improve the same play's listening time and history, yet lets concurrent closes both observe an open session and apply final syncs before either closes it. Use a serialized, session-ID-keyed finalization operation that rejects duplicate or stale submissions, accepts legitimate advances, and updates resume/native playback state only for the accepted finalization.

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The race is real. Two closes could both see the session open and both apply a final sync, adding the listening time twice. Fixed in 7ed5167. The final sync and the close are now one UPDATE … WHERE closed_at IS NULL that reports whether that request closed the session. Only the request that closes it updates the resume position and the native session, and notifies other clients. Every other close, whether concurrent, retried or late, returns 204 and changes nothing. Checked on a test server: two closes with different positions left the first close's position and listening time in the history row.
▎
▎ I haven't made a later close with a further position replace the first one. Once a session is closed the play is over: the native session and its history row are finished, and a close that arrives after that isn't new listening on that play. The resume position already never moves backwards.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Based on your description of 7ed51674b, the atomic UPDATE … WHERE closed_at IS NULL resolves the concurrent-close race: only the winning request applies the final sync and triggers the resume/native-session updates and notifications.

My original suggestion was too broad in requiring later closes with a further position to be accepted. First-close-wins is a valid finalization contract: once the play is closed, retries and late requests should be no-ops, not reopen or revise its history. A greater position alone does not establish new listening.

The reported two-close test supports that behavior. I would consider this finding addressed as described; accepting later advances is not necessary.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e0138407-bf70-4b08-a2fd-8d466aacb3ed
Commits

Reviewing files that changed from the base of the PR and between 48b895f and 7959f8f.

Files selected for processing: 21
  • cmd/silo/session_sync.go
  • contracts/api/v2/openapi.json
  • internal/api/handlers/playback.go
  • internal/api/handlers/playback_sessions.go
  • internal/api/handlers/playback_test.go
  • internal/apiv2/admin_sessions.go
  • internal/apiv2/profiles.go
  • internal/audiobooks/abs/native_sessions.go
  • internal/audiobooks/abs/native_sessions_test.go
  • internal/audiobooks/abs/play_response.go
  • internal/audiobooks/abs/progress.go
  • internal/audiobooks/abs/session_local.go
  • internal/audiobooks/abs/session_local_test.go
  • internal/playback/session.go
  • internal/playback/session_activity.go
  • internal/playback/session_remote_transport_test.go
  • internal/playback/watch_time.go
  • internal/playback/watch_time_test.go
  • internal/worker/reconciler.go
  • migrations/sql/20261026180735_playback_session_timeline_duration.sql
  • web/src/api/v2/schema.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

…lo-Server#3108

- Keep the frozen /api/v1 session file_duration as the file's duration;
  only the v2 session reads report the whole book's length.
- Cap the reported plays one account can have live at ten. They are
  outside stream limits, so nothing else bounded them.
- Close an Audiobookshelf session and apply its final sync in one
  statement that reports whether this request closed it. Of concurrent
  or repeated closes only that one updates the resume position, the
  native session and other clients.
- Measure a new reported play from where and when the client says it
  began even when it reports no listening total.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-triage silo-triage Bot added size/XXL 1000–2999 added + deleted lines (all files); change volume, not priority. and removed size/XL 500–999 added + deleted lines (all files); change volume, not priority. labels Oct 26, 2026
@silo-kody

silo-kody Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@macroscopeapp

macroscopeapp Bot commented Oct 26, 2026

Copy link
Copy Markdown

The Evidence page covers Activity and Playback History at desktop and phone width, but it does not show the changed resume behavior: a final session-close sync now updates the resume position. Please add a before-and-after capture of the affected client resuming from that position, or matching before-and-after API response excerpts for the resume position.

Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness.

Posted via Macroscope — Visible change evidence

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6a56a7cf-8b37-49ca-8171-cbe5d4e23ae5
Commits

Reviewing files that changed from the base of the PR and between 7959f8f and 7ed5167.

Files selected for processing: 10
  • internal/api/handlers/playback_sessions.go
  • internal/apiv2/admin_sessions.go
  • internal/apiv2/profiles.go
  • internal/audiobooks/abs/file_handler_public_track_test.go
  • internal/audiobooks/abs/native_sessions.go
  • internal/audiobooks/abs/progress.go
  • internal/audiobooks/abs/session_local_test.go
  • internal/audiobooks/abs_playback_session_store.go
  • internal/playback/session.go
  • internal/playback/session_remote_transport_test.go
Files skipped from review as they are similar to previous changes: 1
  • internal/api/handlers/playback_sessions.go

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

Comment thread internal/audiobooks/abs/progress.go Resolved
Comment thread internal/audiobooks/abs/progress.go Resolved
- A sync whose session row fails to save writes nothing else: the client
  gets an error and syncs again, and the retry would count the same
  listening twice.
- A sync's or close's listening time is bounded to [0, 1 day] before it
  is added to the session's stored total.
- Remove the breaking-change approvals Silo-Server#3050 added; they match no change
  now that Silo-Server#3050 is in main.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@macroscopeapp

macroscopeapp Bot commented Oct 26, 2026

Copy link
Copy Markdown

The v2 household session response now returns the whole-book timeline in file_duration (internal/apiv2/profiles.go), but the evidence page is described as web admin Activity and Playback History captures. Please add before-and-after response excerpts for the same household-session request showing this field and identify the builds/commits.

Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness.

Posted via Macroscope — Visible change evidence

@Brady3035

Copy link
Copy Markdown
Contributor Author

The v2 household session response now returns the whole-book timeline in file_duration (internal/apiv2/profiles.go), but the evidence page is described as web admin Activity and Playback History captures. Please add before-and-after response excerpts for the same household-session request showing this field and identify the builds/commits.

Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness.

Posted via Macroscope — Visible change evidence

Added to the evidence page: before-and-after Audiobookshelf API excerpts for the same requests on both builds. A regular account sets progress to 600, opens a session, syncs at 700, then closes with a final position of 900. Reading the progress back gives 700 on main (48b895f) and 900 on this branch (77749bc).

@Brady3035

Copy link
Copy Markdown
Contributor Author

Think this should be ready :)

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (2)

Minor · Preserve absent listening fields separately from explicit zero. · native_sessions.go:151-158

internal/audiobooks/abs/native_sessions.go:151-158
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Preserve absent listening fields separately from explicit zero.

A sync body with currentTime but no listening field reaches UpdateProgressListened with listened == 0. WatchTime.Credit then drops the position interval while advancing its baseline. The mirrored native session carries that undercount into the admin history Watch value.

Do not route every zero through Observe. An explicit timeListening: 0 or timeListened: 0 is accepted by this request type and means that the client reported no listening. Observe could count a forward seek as playback. Preserve field presence and use UpdateProgress only when neither listening field was supplied.

Suggested fix
 type syncPayload struct {
 	CurrentTime float64 `json:"currentTime"`
 	// Accept both spellings: real ABS clients send "timeListening"; an older
 	// silo-plugin draft used "timeListened". UnmarshalJSON merges them.
-	TimeListening float64 `json:"timeListening"`
-	TimeListened  float64 `json:"timeListened"`
+	TimeListening *float64 `json:"timeListening"`
+	TimeListened  *float64 `json:"timeListened"`
 }
 
 // timeDelta returns the accumulated listening time from whichever spelling
 // the client used. Both fields are tried; non-zero wins. It is bounded to
 // [0, maxSyncListeningSeconds], so a client cannot lower the stored total or
 // overflow it.
 func (p syncPayload) timeDelta() float64 {
-	delta := p.TimeListened
-	if p.TimeListening != 0 {
-		delta = p.TimeListening
+	var delta float64
+	if p.TimeListened != nil {
+		delta = *p.TimeListened
+	}
+	if p.TimeListening != nil && *p.TimeListening != 0 {
+		delta = *p.TimeListening
 	}
 	return min(max(delta, 0), maxSyncListeningSeconds)
 }
 
+func (p syncPayload) hasListening() bool {
+	return p.TimeListening != nil || p.TimeListened != nil
+}
+
@@
-	h.updateNativePlaybackProgress(ctx, sess.ID, p.CurrentTime, p.timeDelta())
+	h.updateNativePlaybackProgress(ctx, sess.ID, p.CurrentTime, p.timeDelta(), p.hasListening())
-func (h *Handler) updateNativePlaybackProgress(ctx context.Context, sessionID string, position, listened float64) {
+func (h *Handler) updateNativePlaybackProgress(ctx context.Context, sessionID string, position, listened float64, listeningReported bool) {
 	if h == nil || h.deps.NativeSessions == nil || sessionID == "" {
 		return
 	}
-	if err := h.deps.NativeSessions.UpdateProgressListened(sessionID, position, listened); err != nil {
+	var err error
+	if listeningReported {
+		err = h.deps.NativeSessions.UpdateProgressListened(sessionID, position, listened)
+	} else {
+		err = h.deps.NativeSessions.UpdateProgress(sessionID, position, false)
+	}
+	if err != nil {
Minor · Do not use incomplete metadata as the whole-book duration. · native_sessions.go:205-253

internal/audiobooks/abs/native_sessions.go:205-253
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Do not use incomplete metadata as the whole-book duration.

bookDurationSeconds ignores zero-duration files while summing the others. A multi-file book such as [3600, 0] therefore gets a positive TimelineDuration of 3600 in both native-session paths. Admin history then uses that partial value and can mark playback complete after the first file, before the book ends.

Treat the whole-book duration as unknown unless every file has a positive duration. Make that state explicit so admin history omits completion and does not fall back to the first file's duration.


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bb6a7832-60db-406d-80df-97a26fb75e8c
Commits

Reviewing files that changed from the base of the PR and between 77749bc and 828128e.

Files selected for processing: 11
  • cmd/silo/session_sync.go
  • contracts/api/v2/fixtures/list_home_sections_item_limit_out_of_range.json
  • contracts/api/v2/fixtures/list_library_sections_item_limit_out_of_range.json
  • contracts/api/v2/openapi.json
  • internal/api/handlers/playback_sessions.go
  • internal/api/handlers/playback_test.go
  • internal/apiv2/admin_sessions.go
  • internal/apiv2/profiles.go
  • internal/playback/session.go
  • internal/worker/reconciler.go
  • web/src/api/v2/schema.ts
Files skipped from review as they are similar to previous changes: 1
  • web/src/api/v2/schema.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

# Conflicts:
#	internal/audiobooks/abs/native_sessions.go
#	internal/audiobooks/abs/progress.go
#	internal/playback/session.go
#	internal/playback/session_activity.go
#	internal/worker/reconciler.go
@Brady3035

Copy link
Copy Markdown
Contributor Author

Should be good here.

@Quick104 Quick104 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of df5b940 (this branch with current main merged in; I pushed that merge because main had changed progress.go and session.go underneath it).

The whole-book length, the close's final sync and the reported listening time work on a single server: on a dev sandbox, a /play session that synced three times across a 200-second scrub and then closed with a final body recorded 900 s of book length and 40 s played, which is right. The findings below are the multi-server gaps in those three parts, which I'm fixing on this branch, and two problems in the tracking of plays reported only through /session/local, which need a maintainer decision.

🤖 Claude Code (claude-opus-5-5)

Comment thread internal/api/handlers/playback.go Resolved
Comment thread internal/audiobooks/abs/progress.go Resolved
Comment thread internal/audiobooks/abs/progress.go Resolved
Comment thread internal/playback/session.go Resolved
…multi-server close

On more than one API server, Audiobookshelf plays lost what this branch
records:

- A close that reaches a server without the native session records the
  play through FinishDetached, which read neither the book length synced to
  playback_sessions_sync nor the close's final sync. LiveSession now reads
  timeline_duration_seconds, the detached snapshot takes it, and the close
  applies its accepted final sync to the row it hands to the stop.
- A /play sync credited only its own timeListened, so a sync handled
  elsewhere lost its listening. Syncs now pass the row's running total to
  UpdateProgressReported, which credits how far it rose since the last total
  the session saw; UpdateProgressListened goes.

A report that does not raise the total no longer moves the listening
baseline, so a delayed lower total cannot shrink the next rise's cap. The
AdminPlaybackSessionView doc comment is back on the alias.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@Quick104

Quick104 commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Review summary (head dcdec18)

Audiobookshelf plays now show their whole-book length in Activity and Playback History, keep a close's final sync, and count the listening time the app reports, on single-server and multi-server setups. Plays that apps report only through /session/local (Plappa, Prologue) are no longer part of this PR. #4244 tracks rebuilding that on the playback lifecycle path.

Branch update. I merged current main into the branch (df5b940) before reviewing, because main had changed progress.go and session.go underneath it. The one conflict, in countsTowardLimitsLocked, keeps main's new paused-slot cap. The merge also fixed the failing size check.

Fixed on the branch

  • 9d371b0:
  • dcdec18: removed the report-only tracking of /session/local plays (ReportOnly, IdleGrace, RegisterReportOnly). It kept plays in one server's memory, outside the lifecycle. On a dev sandbox, a play that resumed after its 90-second expiry vanished from Activity for up to 25 hours, a server dying mid-play would lose the history row, and servers could hold competing copies. Local sessions move the resume position again, as on main.

Left as is: two closes for the same session at the same moment can let the losing one finish the native session before the winner mirrors its final sync. It needs two concurrent closes from one client.

Verification

  • Dev sandbox, before at feae205b (main) and after at dcdec189. A scripted ABS client on a 3-file, 15-minute book resumed at 7:12, synced every 10 s for a minute and closed with a final sync.
    • Main: Activity showed 7:32 / 5:00 and history 1m 0s of 5m 0s, Completed.
    • This branch: Activity showed 7:32 / 15:00 and history 1m 5s of 15m 0s, Partial.
    • A /session/local report on this branch moves the resume position and creates no session.
  • Tests that fail on df5b940 and pass now: the "final sync on another replica" case in TestHandleSessionCloseFinishesNativePlaybackSession, and TestUpdateProgressReportedStaleTotalKeepsBaseline. They cover the multi-server cases, which one sandbox server can't show. This PR's other new tests don't build on main, so they don't count as proof.
  • Focused Go tests and lint-changed are clean. The one exception is an FFmpeg subtitle test that fails the same way on main with the local FFmpeg build.
  • Cross-provider review: Codex (gpt-6.1-sol, xhigh) on df5b940. Its findings are the ones above.

Evidence: https://evidence.siloserver.org/r/silo-server/pr-3108/

Validated features: no passed case on the v1.0 board is affected. Stream limits (#1196, #1197) and idle expiry (#1177, #1178) no longer change at all. Validation tasks: none.

User manual: unaffected. The Audiobookshelf page doesn't describe Activity or history for these plays.

Other clients: N/A. This is a server change, and the web, Apple and Android apps read file_duration, which now carries the book length for these sessions.

Fit: 8/10 · Readiness: 9/10 — conditional (assuming CI is green)

  • Fit: these are bug fixes on a surface that is beta for 1.0. They are placed where the existing code handles this, and keep to the playback lifecycle. They add one nullable column, and for these sessions file_duration now means the book's length rather than the file's. /api/v2 isn't locked yet and the field's description says so. Both are small stretches.
  • Readiness: shown live before and after on the sandbox. The multi-server paths are covered by tests that failed before the fix. Only the rare concurrent-close case remains.

🤖 Claude Code (claude-opus-5-5)

… follow-up

Plays that clients report only through /session/local were mirrored into
report-only native sessions held in one server's memory, outside the
playback lifecycle every other play uses. A play resumed after its idle
expiry reused an ID whose lifecycle row was already stopped, so Activity
hid it for up to 25 hours; a server that died mid-play lost its history
row; and servers could hold competing copies of one play.

This removes that tracking (ReportOnly, IdleGrace, RegisterReportOnly and
the /session/local mirroring) so the whole-book length, the close's final
sync and the reported listening time can land on their own. Local sessions
move the resume position, as before. A follow-up rebuilds the tracking on
the lifecycle path.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-triage silo-triage Bot added size/XL 500–999 added + deleted lines (all files); change volume, not priority. and removed size/XXL 1000–2999 added + deleted lines (all files); change volume, not priority. labels Nov 15, 2026
@silo-kody

silo-kody Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@Quick104
Quick104 merged commit ae371ac into Silo-Server:main Nov 15, 2026
22 checks passed
@Brady3035
Brady3035 deleted the abs-playback-tracking branch November 15, 2026 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-v2 API v2 / Huma migration program (epic #135); long-running, stacked by phase bug Something isn't working go Pull requests that update go code impact: playback Can't play, stalls, or wrong media javascript Pull requests that update javascript code priority: P2 Limited scope, workaround exists, or polish size/XL 500–999 added + deleted lines (all files); change volume, not priority.

Projects

None yet

2 participants