You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(admin): add Insights dashboard widgets, breakdowns and a Library tab - #5279
Related issue: N/A
Validation tasks: none
Other clients: Apple N/A (admin web only; no client reads these endpoints); Android N/A (admin web only); Roku N/A (admin web only)
Insights (#5269) shows admins how their server is used, but none of its charts can go on the dashboard, and the dashboard's Top titles and Most active profiles count finished plays while Insights counts plays, so the two disagree. Insights also can't yet say which days and hours are busiest, how many people watch in each period, how sessions end, which app versions are in use, how subtitles and audio tracks are used, or how much of each library anyone watches.
This PR:
offers six Insights charts as dashboard widgets, with an Add to dashboard button on the matching Insights cards;
moves Top titles and Most active profiles to Insights counting;
adds breakdowns to the Playback, Titles and Devices & Quality tabs;
adds a Library tab, and lets the Insights tab row scroll on a phone.
Approach
Dashboard widgets: Playback over time, Viewing hours, Plays by day of week, Plays by hour of day, Active people and Library coverage. They read the Insights endpoints for the whole server in the browser's timezone. Their window picker offers 7d, 30d, 90d, 1y and All; 90d, 1y and All are new and appear only on Insights widgets. They refresh every 5 minutes on 7 and 30 days and every 15 minutes on longer windows instead of on the dashboard's 60-second loop, and the dashboard's Refresh reloads them.
Add to dashboard puts the card's widget in the admin's saved layout, on the window the page shows. Library and account filters don't carry over. Once the widget is placed, the button becomes a link to the dashboard. The Insights page uses the same useDashboardLayout as the dashboard, so an add goes through its revision-checked save. The dashboard now waits for a layout save that is still running, and for the refetch after it, before adopting the server copy; without that, opening the dashboard right after an add showed the layout from before it.
Top titles and Most active profiles read Insights (titles sorted by plays, and a new people.top_profiles), so they match the Titles and People tabs. Insights windows start at 7 days, so these two widgets lose the 24-hour window, and one saved on 24 hours opens on 7 days. getAdminDashboardTopActivity stays because monitoring API keys may read it; only the web app stops using it.
New fields on existing reads, all additive:
Activity: active_accounts and active_profiles per bucket, and end_reasons (sessions by how they ended).
Titles: least_finished, titles with at least 3 plays and at least one left unfinished, ranked by the share finished.
New read GET /api/v2/admin/insights/library (getAdminInsightsLibrary), advertised by the library capability, open to monitoring keys and cached like the other Insights reads, including feat(admin): add playback Insights and rework Playback History #5269's cancellation of a fill no request still waits on. For movies and series, per library and in total, it reports the share played in the window, titles never started, titles added in the window and how long they waited for a first play, plays by genre, release decade and content rating, and the newest titles added and not yet played. Window counts use only the window's plays, like every Insights read. "Never started" and "not played yet" describe today: for a window that ended in the past, a second pass groups only the sessions of the titles it added that had no play in it, from the window's start to now. It is a report; nothing acts on files.
The Insights tab row scrolls sideways below lg with no scrollbar, fades the edge that has more tabs past it, and keeps the active tab in view, using the same useScrollStrip as the user detail tabs.
docs/admin-api.md documents every new field and the Library read.
Rebased onto main after #5269 merged. The full gate ran on the rebased branch at 5deeb63; the review fixes after it were checked with the handlers and apiv2 packages against a freshly migrated database, make lint-changed, the v2 contract checks, the web typecheck, lint and format, and the Insights and i18n tests.
Go: build, gofmt, go mod tidy -diff, go vet ./..., make lint-changed and make lint-router-recovery (0 issues), make test-go: pass.
Database: the handlers, apiv2 and middleware packages against a freshly migrated database: pass. The Insights play grouping test also covers per-bucket active counts, end reasons, least finished and top profiles. The breakdowns test covers app versions, the Silo vs Jellyfin split, subtitles, audio and the Library read, including a window that ended in the past: a title first played after it, and a false start just before its end resumed just after, which is no play in the window but is the title's first play as of now.
Contracts and hygiene: route inventory, v2 OpenAPI, web types, fixtures, contract against main (no breaking change), committed artifact, local paths, case collisions, fork pins, settings bindings, playback fixtures, migrations, size ratchet, bidi: pass. Not run: actionlint, ShellCheck and the Prometheus rules check; this PR changes no workflows, shell scripts or alert rules.
Web: lint, format, typecheck, build, bundle budget, and the web tests in eight shards: pass.
en-XA: on the new screens, only data (names, titles, genres, dates) and locale-formatted weekdays, hours and language names stay in plain English.
Phone width (390 px): no horizontal overflow on the Library, Playback and Devices & Quality tabs. The tab row scrolls; opened on Devices & Quality it starts with that tab in view, Bandwidth is reachable, and at desktop width all six tabs fit with nothing to scroll.
Add to dashboard followed at once by the On dashboard link: the dashboard opened with the new widget, the server layout held it, and the next dashboard edit saved.
On a deployment with a large real library, every Insights read answers 200. The Library read takes 2.6 s cold on 30 days and 4.0 s on all time, 0.15 s cached; the other reads take 0.2 to 0.5 s.
Surface and build: web admin dashboard and Insights, desktop and phone width, on seeded demo data. Before is #5269's head (22d20f9); after is a5cb25d, with the dashboard, Add to dashboard and Library captures retaken on 4fdd358 after the first review fixes, and the phone tab row captured before (5deeb63) and after (31dc48f).
Risks
The Library read is the slowest Insights read: about 4 s cold on all time for a large library. Its 60-second cache is shorter than the widget's refresh interval, so most widget refreshes are cold reads. The Insights read gate runs at most three Insights reads per node at a time. A custom window that ended in the past adds a second, item-filtered pass over the titles it added without a play.
Top titles and Most active profiles change what they count and lose the 24-hour window.
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 how I checked a change nobody sees.
AI Disclosure
Harness: Claude Code (in T3 Code)
Tool(s): Claude Code, GitHub CLI, Playwright MCP
Model(s): claude-opus-5-5
Involvement: AI-assisted
Adversarial review: two independent Claude Code reviewer agents (claude-opus-5-5), one on the Go diff and one on the web diff, each given the code and the intended behavior and asked for correctness, security and performance bugs. They raised 8 findings; 6 were fixed (among them a dashboard opened right after Add to dashboard adopting the layout from before the add, and Library breakdowns counting items other than movies and series) and 2 declined (per-bucket active counts use sessions like feat(admin): add playback Insights and rework Playback History #5269's summary; the dashboard's Refresh goes through the 60-second server cache). On this PR, Codex, CodeRabbit and Kody raised 12 more: 8 fixed, including two that my own interim fix introduced (sessions after a past window changing its play counts, and a narrow past window regrouping all later history), and 4 declined with reasons on the threads; the reviewer withdrew 3 of those, and the Codex thread on the All time lower bound stays open.
Add Library tab, Insights dashboard widgets, and breakdown endpoints to admin Insights
Adds a Library insights read (GET /api/v2/admin/insights/library) with catalog coverage, genre/decade/rating breakdowns, first-play timing, and recently added unplayed titles, backed by a TTL cache in admin_insights_cache.go
Adds breakdown data to existing Insights reads: session end reasons and per-bucket active account/profile counts (Activity), top profiles (People), least-finished titles (Titles), and client-version, protocol, subtitle, and audio breakdowns (Devices)
Registers six Insights-backed dashboard widgets with new quarter/year/all ranges, and adds AddToDashboardButton so Insights cards can pin widgets with a matching range
Replaces the old top-activity query in TopTitlesWidget and TopProfilesWidget with the Insights Titles and People queries, and removes the useAdminTopActivity hook and its API types
Fixes useDashboardLayout to not adopt a remote server layout while a fetch or layout write from another page is in progress
Risk: widgets using the new quarter/year/all ranges use 720-hour windows; sampled widgets do not offer them and endpoints clamp to 31 days, so check range.ts and callers of the removed rangeDays export
We couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting @coderabbitai full review.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
Walkthrough
Admin Insights gains Library analytics and expanded activity, people, device, and title metrics. The API contracts and handlers expose the data. The web app adds Insights views, dashboard widgets, and range options, with translations across supported locales.
Responses add active account and profile counts, session end reasons, cross-account top profiles, device usage breakdowns, and least-finished titles. API mappings, contracts, fixtures, and database tests cover these fields.
A Library read reports catalog coverage, play breakdowns, first-play timing, and recently added unplayed titles. The endpoint supports window and scope parameters, refresh behavior, and cached reads for non-custom ranges.
Insights pages and dashboard widgets web/src/pages/admin-insights/*, web/src/components/admin/insights/*, web/src/components/admin/dashboard/*, web/src/hooks/queries/admin/*, web/src/api/v2/*
The web app adds Library and device usage sections, activity charts, dashboard pins, and six Insights widgets. Dashboard ranges include quarter, year, and all history.
Translations and generated locale keys .silo-translations, web/src/locales/*, web/src/locales/keys.ts
Locale files and message keys add labels for the new ranges, widgets, and Insights metrics. The translation configuration version and hash are updated.
sequenceDiagram
participant AdminUser
participant InsightsLibraryTab
participant LibraryQuery
participant LibraryAPI
participant LibraryHandler
participant Database
AdminUser->>InsightsLibraryTab: Select Library Insights
InsightsLibraryTab->>LibraryQuery: Request filtered library data
LibraryQuery->>LibraryAPI: GET /api/v2/admin/insights/library
LibraryAPI->>LibraryHandler: ReadAdminInsightsLibrary(window, refresh)
LibraryHandler->>Database: Query library metrics
Database-->>LibraryHandler: Coverage and play aggregates
LibraryHandler-->>LibraryAPI: Library result
LibraryAPI-->>LibraryQuery: AdminInsightsLibrary response
LibraryQuery-->>InsightsLibraryTab: Render metrics and breakdowns
Loading
Merge Risk: Low · previous review 4fdd3
The Library Insights report can misclassify titles that played before they were added to a selected library. Several translated labels overstate what the data means. Neither blocks the feature, and both are small fixes to make before or soon after merge.
Security architecture risk: Minimal · up to 4fdd3
Existing monitoring keys can read the new Library report, but they cannot force a shared analytics refresh. The report stays behind administrator authorization and uses the existing limits on database work. The review did not establish a material regression in security or failure containment.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
observed — An existing monitoring key that satisfies the admin check gains access to server-wide Library analytics or a filtered view. The base already granted that credential catalog and playback-history reads, but not the combined Library report.
Trust Boundaries and Controls
observed — Authentication enforces the key's route allowlist and copies its stored scopes into request claims. The Library route uses those claims to discard a scoped key's refresh request before the handler can invalidate the shared cache. This blocks forced invalidation, not ordinary cache misses or custom-window database reads.
Resilience and Maintainability Implications
observed — Authorized invalidation clears the Library cache with the other Insights caches. Failed fills do not publish, and a fill from a previous generation cannot repopulate the cache, even though a caller already awaiting that fill can still receive its result. Provider shutdown closes the Library cache's TTL sweeper.
observed — Custom reads and cache fills use the same per-process gate of three concurrent gated reads, a two-minute read deadline, and bounded transaction cleanup. A shared fill may outlive its initiating request, but it keeps its own deadline.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "feat(admin): add Insights dashboard widgets, breakdowns and a Library tab" matches the main changes in the changeset: six Insights dashboard widgets, device/playback/titles breakdowns, and …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description lays out the problem, approach, validation, evidence, and risks for the changeset. It names the Insights dashboard widgets, the Library tab, the new breakdown fields, and the `GET /api…
Full details: Title check
Explanation
The title "feat(admin): add Insights dashboard widgets, breakdowns and a Library tab" matches the main changes in the changeset: six Insights dashboard widgets, device/playback/titles breakdowns, and the new Library tab and read endpoint. It is specific and conventional-commit formatted. It omits the least-finished titles and the Top titles/Most active profiles switch, but it does not need to cover every detail.
Full details: Description check
Explanation
The description lays out the problem, approach, validation, evidence, and risks for the changeset. It names the Insights dashboard widgets, the Library tab, the new breakdown fields, and the GET /api/v2/admin/insights/library read. It is specific and directly related to the changed files.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
The reason will be displayed to describe this comment to others. Learn more.
Include catalog additions before playback history in all-time reads
When a library was scanned before the first recorded playback, selecting All time excludes those initial titles from the added-title count, first-play statistics, and recently-added-unplayed list. resolveAllTimeBounds sets win.From to the oldest playback-history day (or only 30 days ago when history is empty), and this predicate then uses that display bound as a catalog cutoff. Unlike the other all-time history queries, it never bypasses the lower bound for win.AllTime. Use an unbounded catalog start for all-time reads, or resolve the start from catalog additions as well, so existing catalog data is not silently omitted.
The reason will be displayed to describe this comment to others. Learn more.
Leaving the all-time bound in place, on purpose. All time starts at the first recorded playback because nothing before it can be measured: a title first seen before history began has no recorded first play to compare its add date with. Including the initial scan would make "Added this period" cover the whole library and would count the gap before history began as waiting time in the median and the buckets. Coverage and "never started" don't use this bound, so the existing catalog isn't left out of those counts. Only the added-in-window figures stay within the history the server has.
Included review availability: This review used your included allowance. 3 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 4 reviews per hour.
Activity buckets now count active accounts and profiles, and Activity
counts sessions by end reason. Titles lists the least-finished movies and
series, People ranks profiles across accounts, and Devices adds client
versions, a Silo vs Jellyfin-client split per bucket, and the subtitles
and audio sessions with route facts used.
GET /api/v2/admin/insights/library reads the catalog against the
window's plays: per-library coverage, titles never started, plays by
genre, decade and content rating, and how soon new titles get a first
play. Monitoring keys may read it like the other Insights reads.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dashboard gains Playback over time, Viewing hours, Plays by day of
week and Plays by hour of day widgets, read from Insights with windows
from 7 days to all time. Top titles and Most active profiles now count
plays the way the Titles and People tabs do, so the dashboard and
Insights agree; their shortest window is 7 days.
Insights widgets pace themselves (5 minutes for short windows, 15 for
long ones) instead of following the dashboard's 60-second loop, and the
Refresh button marks them stale. Insights cards that have a dashboard
widget get an Add to dashboard button.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ghts
The Playback tab adds plays by day of week and hour of day, active
people per period, and how sessions end. Titles adds the least-finished
movies and shows. Devices & Quality adds Silo apps vs Jellyfin apps over
time, the app versions in use, and the subtitles and audio sessions
played. Active people is also a dashboard widget.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tab shows how much of each movie and TV library was played, titles
nobody ever started, plays by genre, release decade and content rating,
how long new titles waited for a first play, and the newest titles still
waiting. Library coverage is also a dashboard widget.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Least finished leaves out titles nobody left unfinished. The Viewing
hours widget uses shorter cells so its legend fits three rows, the
Subtitles and Audio cards take the full width so their labels don't
truncate, and App versions shows the last-seen date without the time.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Genres, decades and content ratings counted plays of any item type that
history holds, so they did not reconcile with the movie and series
coverage beside them. The never_started description now says it counts
sessions up to the window's end, which is what the query reads.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add to dashboard saves as the Insights page unmounts. A dashboard opened
from the On dashboard link mounted on the cached layout from before that
save, adopted it, dropped the new widget and then saved against a
version the server no longer held. The dashboard now waits for a layout
write still running, and for its refetch, before it settles.
Also: Insights widgets keep their last data through a failed poll, the
coverage bars draw the played share against 100%, and Add to dashboard
shows only once the layout can be saved.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Six tabs are wider than a phone screen: Devices & Quality was cut off and
Bandwidth could not be reached. The tab row now scrolls sideways below the
lg breakpoint with no scrollbar, fades the edge that has more tabs past it,
and keeps the active tab in view, like the user detail page's tabs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
For a window that ended in the past, the Library read called a title
never started or not played yet when its first session or play came after
the window, though the labels read as today's state. Never started now
looks at every session up to now, and the first play is looked up from the
window's start to now; played in the window still counts only the
window's plays.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Looking up first plays to now had widened the whole Library play pass to
now. Sessions after a past window then joined viewings that began in it,
so a false start resumed later counted as a play in the window, and a
narrow window long ago regrouped all the history since. The pass is
bounded to the window again; a separate lookup finds, from the window's
end to now, the first play of only the added titles that had none in it.
The docs also say how a library's added count differs from the summary's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 settingsReview Options
The following review options are enabled or disabled:
Options
Enabled
Bug
✅
Performance
✅
Security
✅
Business Logic
❌
⚠️ 4 Kody Rule(s) were not evaluated
These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:
Preserve optional store capabilities through production wrappers
Detach mandatory cleanup from request cancellation and bound its lifetime
Preserve durable media identity and share identity-evidence precedence
Bound decoder throughput trades and share direct-play eligibility
… play
The later first-play lookup grouped sessions from the window's end, so a
false start inside the window resumed just after it lost its opening
sitting and never counted, leaving the title not played yet. The lookup
now groups the waiting titles' sessions from the window's start; window
counts still come from the bounded pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(admin): add Insights dashboard widgets, breakdowns and a Library tab (#5279)
* feat(insights): add breakdowns and a Library read to the Insights API
Activity buckets now count active accounts and profiles, and Activity
counts sessions by end reason. Titles lists the least-finished movies and
series, People ranks profiles across accounts, and Devices adds client
versions, a Silo vs Jellyfin-client split per bucket, and the subtitles
and audio sessions with route facts used.
GET /api/v2/admin/insights/library reads the catalog against the
window's plays: per-library coverage, titles never started, plays by
genre, decade and content rating, and how soon new titles get a first
play. Monitoring keys may read it like the other Insights reads.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(web): put Insights charts on the dashboard
The dashboard gains Playback over time, Viewing hours, Plays by day of
week and Plays by hour of day widgets, read from Insights with windows
from 7 days to all time. Top titles and Most active profiles now count
plays the way the Titles and People tabs do, so the dashboard and
Insights agree; their shortest window is 7 days.
Insights widgets pace themselves (5 minutes for short windows, 15 for
long ones) instead of following the dashboard's 60-second loop, and the
Refresh button marks them stale. Insights cards that have a dashboard
widget get an Add to dashboard button.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(web): show the new playback, title and device breakdowns in Insights
The Playback tab adds plays by day of week and hour of day, active
people per period, and how sessions end. Titles adds the least-finished
movies and shows. Devices & Quality adds Silo apps vs Jellyfin apps over
time, the app versions in use, and the subtitles and audio sessions
played. Active people is also a dashboard widget.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(web): add a Library tab to Insights
The tab shows how much of each movie and TV library was played, titles
nobody ever started, plays by genre, release decade and content rating,
how long new titles waited for a first play, and the newest titles still
waiting. Library coverage is also a dashboard widget.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(insights): tighten the new breakdowns after a visual check
Least finished leaves out titles nobody left unfinished. The Viewing
hours widget uses shorter cells so its legend fits three rows, the
Subtitles and Audio cards take the full width so their labels don't
truncate, and App versions shows the last-seen date without the time.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* refactor(apiv2): keep the Insights Library and usage types in their own files
admin_insights.go had grown past the size ratchet's 1,000-line limit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(insights): run the breakdowns and Library DB test in CI
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(api): list the Insights Library read in the media route manifest
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(insights): keep Library breakdowns to movies and series
Genres, decades and content ratings counted plays of any item type that
history holds, so they did not reconcile with the movie and series
coverage beside them. The never_started description now says it counts
sessions up to the window's end, which is what the query reads.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(web): keep an Insights add when the dashboard opens right after it
Add to dashboard saves as the Insights page unmounts. A dashboard opened
from the On dashboard link mounted on the cached layout from before that
save, adopted it, dropped the new widget and then saved against a
version the server no longer held. The dashboard now waits for a layout
write still running, and for its refetch, before it settles.
Also: Insights widgets keep their last data through a failed poll, the
coverage bars draw the played share against 100%, and Add to dashboard
shows only once the layout can be saved.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(web): scroll the Insights tabs sideways on a phone
Six tabs are wider than a phone screen: Devices & Quality was cut off and
Bandwidth could not be reached. The tab row now scrolls sideways below the
lg breakpoint with no scrollbar, fades the edge that has more tabs past it,
and keeps the active tab in view, like the user detail page's tabs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(insights): report never started and first plays as of now
For a window that ended in the past, the Library read called a title
never started or not played yet when its first session or play came after
the window, though the labels read as today's state. Never started now
looks at every session up to now, and the first play is looked up from the
window's start to now; played in the window still counts only the
window's plays.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(apiv2): use a made-up title in the Insights least-finished fixture
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(insights): keep Library window counts to the window
Looking up first plays to now had widened the whole Library play pass to
now. Sessions after a past window then joined viewings that began in it,
so a false start resumed later counted as a play in the window, and a
narrow window long ago regrouped all the history since. The pass is
bounded to the window again; a separate lookup finds, from the window's
end to now, the first play of only the added titles that had none in it.
The docs also say how a library's added count differs from the summary's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(insights): count a viewing resumed after a past window as a first play
The later first-play lookup grouped sessions from the window's end, so a
false start inside the window resumed just after it lost its opening
sitting and never counted, leaving the title not played yet. The lookup
now groups the waiting titles' sessions from the window's start; window
counts still come from the bounded pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* chore(web): pin translations 2026.11.25-dbc5ec8 for the corrected embedded-subtitle label
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* feat(directconn): run the direct connection engine on one API replica at a time (#5273)
* build(directconn): take shunpike and its forks from the darthShadow paths
The module requires github.com/darthShadow/shunpike v0.1.1 again, and the
quic-go and Tailscale replace lines point at github.com/darthShadow/quic-go
and github.com/darthShadow/tailscale, both still tagged -shunpike.2. The
directconn imports, the shunpike path constant in scripts/ci/forkpins and
its test fixtures, and the shunpike entry in THIRD_PARTY_NOTICES.md use
the same paths. go.sum is regenerated for them.
Signed-off-by: Anagh Kumar Baranwal <6824881+darthShadow@users.noreply.github.com>
* feat(directconn): run the direct engine on a single leased API replica
When direct_connections.enabled is true, the API and integrated modes
now start the shunpike N4 engine and serve HTTP/3 on its UDP socket.
Only one API replica may run it, so two replicas can no longer present
the same direct identity. Production code still registers no peers, so
no client can connect yet. Enrollment, registration, and direct
playback are not part of this change.
Replica gate. The engine shares the API replica presence marker that
network access providers already use. A census counts live markers
every 30 seconds. A Redis lease (silo:direct:engine-lease, SET NX PX
90000, renewed every 30 seconds) lets one holder run the engine, and
the holder stops it once its last successful renewal is older than 60
seconds. The census and the lease call each have their own 2-second
bound, so a slow census cannot expire the renewal. The presence and
the lease use a Redis client that honors context deadlines, so a Redis
that stops answering cannot stall startup or shutdown. Without Redis
there is no census or lease and the engine may run. When Redis is
configured but its client fails to build, or the presence has no
identity, the gate stays closed with replica_census_unavailable. With
more than one replica, or a failed census, a valid holder keeps its
established sessions but new direct connections are unavailable. The
gate table is in docs/architecture/direct-connections.md.
cache.APIReplicaPresence gains ID and Refresh, bounds each marker write
to 2 seconds, and Register now starts renewal even when its first
write fails, so the marker appears once Redis recovers. When the
Register context ends, the marker is deleted and neither renewal nor a
late Refresh writes it again, so a stopped replica does not reappear in
the census. A presence registers once per process.
warnOnMultipleAPIReplicas reads the marker that main registers instead
of registering its own.
Engine lifecycle. The node key comes from HKDF-SHA256 over SECRET_KEY
with the label silo/direct-node/v1|api. The UDP port defaults to 8094.
An invalid port leaves the engine off, and a bind failure is reported.
No engine starts before main builds the HTTP handler it serves; until
then settings reads only record their values, so the lease deadline
stays in force during a slow startup. Each start replays the stored
peer set and builds a fresh HTTP/3 server. Each stop drains that server
before Engine.Close. If a rebind moves the local port, Silo restarts
once on the configured port. The service also rereads settings once a
minute, because Redis drops a settings-change event published while a
subscriber reconnects. A failed start waits for a settings or gate
change. The first successful settings read, changed values, a
SettingsChanged event, or a changed replica gate retries it; the minute
recheck, the follow-up read the service schedules itself, and status
rereads of unchanged values do not. If HTTP/3 Serve returns while its
engine is current, nobody asked it to stop, so Silo detaches the engine
and turns its row off with engine_start_failed before it publishes the
change, then drains and closes the engine. It restarts once after a
settings read and, with Redis, a successful lease renewal or
acquisition, both completed after the exit, if settings still enable it
and the gate permits it. A failed read or renewal keeps the restart
pending. A second unexpected exit leaves it off until settings or the
gate change. On process stop the direct service shuts down beside the
API server's drain: it drains HTTP/3, closes the engine, then ends any
census or renewal in flight and releases the lease, so no successor
holds the lease while this engine is open. The server policy is
n4.DefaultServerPolicy with the configured BBR loss setting.
Request path. The HTTP/3 server reuses the LAN TLS certificate and SPKI
pin with ALPN h3. Before the router runs, the wrapper strips Forwarded,
X-Forwarded-*, X-Real-IP, and both network access ingress headers, sets
RemoteAddr from the engine's observed endpoint for the admitted peer,
and answers 421 when either is missing. It then records
netaccess.Path.Direct on the request context. That identity carries no
user, device, or policy, and grants no application authority.
streamlocation classifies a direct path as remote even from a private
address.
Status and tuning. The status API adds an engine feature and the reasons
multiple_api_replicas, replica_census_unavailable,
replica_lease_pending, replica_lease_held, udp_port_invalid,
udp_port_bind_failed, and engine_start_failed. The direct row turns off
while the gate refuses new connections. Numeric knobs report min and
max bounds, and the tuning package adds SILO_NET_DIRECT_UDP_PORT,
SILO_NET_DIRECT_RECEIVE_WINDOW, SILO_NET_DIRECT_GSO,
SILO_NET_DIRECT_ACK_DECIMATION, and SILO_NET_DIRECT_BBR_LOSS. Bad
values fall back to a default or clamp, never stop startup. The
OpenAPI contract, generated web schema, and Direct Connections admin
section carry the new feature and reason labels, and the admin section
labels the clamped tuning reason.
Docs: docs/architecture/direct-connections.md and network-access.md,
and docs/direct-connections-api.md.
Signed-off-by: Anagh Kumar Baranwal <6824881+darthShadow@users.noreply.github.com>
* fix(directconn): drop the engine's packets once its lease is lost
An API replica that loses the direct engine lease, or lets its last
renewal go stale, no longer sends or accepts direct traffic while the
next holder starts. Two replicas can no longer serve the same direct
identity at once, including across a lease takeover.
Lease fence. The packet connection handed to HTTP/3 drops every packet
in both directions, including segmented writes, as soon as the grant
that started the engine ends or its local deadline (last renewal plus
60 seconds) passes. The drop happens before teardown, and the
transport sees ordinary loss, not an error that would end its server.
A stop the lease forces closes HTTP/3 connections at once, with no
grace period. The fence covers the HTTP/3 path Silo owns; shunpike's
own discovery and transport paths are outside it, and a process paused
between a check and a send is bounded only by the TTL margin.
Grants and hold. A grant is one stretch of ownership of the lease key.
Only Redis's confirmation of an acquisition opens one, and a renewal
answered 0, a release, or a renewal that finishes after the grant's
own 60-second deadline ends it. The acquisition script also accepts a
key that already holds this process's value, so a retry after a lost
reply succeeds. A fresh grant keeps the engine off (reason
replica_lease_pending) until 90 seconds, the lease TTL, have passed
since the send time of the call that opened it, so the previous holder
has stopped before this one serves. A failed lease call is retried
after 5 seconds, and the release runs under its own 2-second bound even
when the shutdown context has ended.
Census. The replica census now reads one Redis sorted set,
silo:api-replicas, scored with each member's expiry in Redis time. One
script call prunes expired members, adds this process if it is missing,
and counts, so a lone marker of another process is never taken for this
one and the cost no longer grows with the keyspace. A process from the
previous release writes no member and is not counted. The census and
lease run only while direct connections are enabled, and are released
when it is turned off, after the engine closes. Every API host registers
the presence, so the multiple-replica warning also works in integrated
mode.
Redis requirement. In server.mode api the engine stays off with
replica_census_unavailable when Redis is not configured, because
separate API processes can share the lease only through Redis. A single
integrated process without Redis still runs it. Two integrated
processes without Redis can overlap during a rolling restart; that case
is documented and left open.
Engine start. A failed start reports udp_port_bind_failed when the
engine could not bind the requested UDP port and engine_start_failed for
any other cause. An engine built while the lease or settings changed
under it is closed unpublished and is not a failure. A peer list the
running engine rejects is not stored, so a restart never replays it. The
direct row turns off with the engine's own reason when the engine is
stopped for a port or start failure, not only for the replica gate. A
settings reread claims a worker slot before shutdown cancels the
service, so Shutdown waits for it.
Tuning and admin. An unrecognized SILO_NET_DIRECT_GSO,
SILO_NET_DIRECT_ACK_DECIMATION, or SILO_NET_DIRECT_BBR_LOSS value now
turns that knob off with reason invalid, as the TCP knobs do. A
malformed SILO_NET_DIRECT_RECEIVE_WINDOW keeps its default with the new
reason invalid_default. The Direct Connections admin section names the
five direct knobs, shows on/off and sizes as people read them, shows a
knob's allowed range, and labels invalid_default. Its new text comes
from the translation catalog; the synced locale files and
.silo-translations are generated.
Signed-off-by: Anagh Kumar Baranwal <6824881+darthShadow@users.noreply.github.com>
* test(directconn): make the shutdown test fail if no census stalls
The lease monitor starts only after a settings read, and New reads
none. TestShutdownInterruptsInFlightReplicaUpdate therefore shut down
before any census ran, and it passed even with the stall path broken.
The test now reads settings once to start the monitor, and fails if no
census reached the stalled Redis call before Shutdown. A broken
interrupt path now fails it.
Also correct the comment in replicaMonitor.update. It said packet
checks read the clock under the lease lock. The fence reads the clock
after that lock, so a renewal that commits on or just before the old
deadline can still leave the fence latched while the grant stays held.
This changes a test and a comment only; no behavior changes.
Signed-off-by: Anagh Kumar Baranwal <6824881+darthShadow@users.noreply.github.com>
---------
Signed-off-by: Anagh Kumar Baranwal <6824881+darthShadow@users.noreply.github.com>
Co-authored-by: Quick <31828688+Quick104@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* feat(web): move live Activity into Insights and add a card layout (#5301)
* feat(web): move live Activity into Insights and add a card layout
Live streams become the first tab of Insights, which now opens on it. The
Activity sidebar entry goes away, its live-session badge moves to Insights,
and /admin/activity redirects to the new tab. The tab keeps its search,
filters, IP lookup, and realtime status in the bar where other tabs hold
their date range, and the page's Refresh re-reads sessions on this tab.
The tab adds a Cards layout beside the table. Each card shows the poster,
who is watching, how the server delivers the stream, and progress; its
details open in a side panel with the same facts, ffmpeg console, and
actions as an expanded table row. The choice is remembered per browser.
Until an admin picks one, a visit with up to eight streams opens as cards
and a busier one opens as the table.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* chore(web): sync translations 2026.11.25-456e313
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(web): return focus to a card's opener when its details panel closes
The card's details panel opens from no Radix trigger, so closing it left
focus nowhere. It now returns to the button that opened it, or to the
card's Details button after a click on the card itself.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* perf(insights): filter unrelated bus events from cache invalidation (#5306)
* perf(insights): filter unrelated bus events from cache invalidation
AdminInsightsProvider previously invalidated all 6 cached Insights tabs and bumped its fill generation on every message published to ChannelPlayback and ChannelAdmin. High-frequency realtime coordination traffic (Watch Together room state and suggestions, subtitle ready/timing/sync, marker updates/thumbnails) and unrelated admin chatter (node reachability/drain, settings, policies, plugins, auth/marker config, login session revocations) repeatedly evicted cached tabs and caused in-flight fills to discard their results.
Filter subscriptions per channel so invalidation only runs for events that can change Insights data:
- ChannelPlayback: playback_sessions_changed
- ChannelAdmin: admin_stats_invalidated, user_disabled, user_deleted, node_pool_changed, item:updated
Add unit tests covering relevant and ignored events on both channels, including in-flight fill preservation and stale-fill rejection.
* fix(insights): invalidate on sign-in revocation and name the item event
A sign-in provider's role change, and an admin edit that changes the
username together with the password, reach the Insights provider only as
user_sessions_revoked. Ignoring that event left the People tab showing the
old role or username until the cache expired. Revocations are rare, so
treat them as relevant again.
Add cache.EventItemUpdated so the metadata publisher, the Insights filter,
and its test share one name instead of a bare "item:updated" string.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(freebsd): emit direct-play ETag and map NFO EMLINK (#5308)
Add a FreeBSD directPlayFilesystemRevision implementation using
syscall.Stat_t (Dev, Ino, Ctimespec, modtime, size), exclude FreeBSD
from the empty fallback, and enable validator assertions for FreeBSD in
directplay_test.go.
Treat syscall.EMLINK alongside syscall.ELOOP from O_NOFOLLOW in
readNFOFile so symlink swaps on FreeBSD return errNFOReplaced.
Closes #5267
* fix(web): handle live Activity load failures and stale details panels (#5303)
* fix(web): handle live Activity load failures and stale details panels
Follow-up to #5301.
- A failed sessions load shows the Insights error panel with Retry
instead of "No active streams".
- The automatic cards-or-table choice waits for a loaded list, so a
failed or unstarted first load no longer fixes the tab on cards.
- A stream that leaves the list clears the open details panel, so the
same session listed again doesn't reopen it. The panel keeps its last
content while it slides closed instead of sliding out empty.
- The bug report template points to Admin > Insights > Activity.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(web): keep the ffmpeg console open while the details panel slides closed
The console reset ran when the panel's session went away, which is the
same render that starts the close animation, so an open console collapsed
mid-slide. Reset it once the panel has finished closing instead, and read
its logs for the session the panel is still showing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(web): cover the live Activity layout lock, Retry, and a failed refresh
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(workmetrics): report due-only queued age for image cache jobs (#5305)
* fix(workmetrics): report due-only queued age for image cache jobs
Future-deferred retries in metadata_image_cache_jobs stay in status='queued'
with next_attempt_at days in the future (for example, 7-day backoff on 403/404
or missing local artwork). Sampling min(created_at) for queued rows caused
SiloQueueAgeHigh to alert whenever any deferred retry existed.
Report min(next_attempt_at) FILTER (WHERE next_attempt_at <= NOW()) for queued
image cache jobs while keeping count(*) across all queued rows and min(created_at)
for running rows. When all queued image jobs are future-deferred, the oldest
queued timestamp metric is omitted so SiloQueueAgeHigh does not false-fire, while
due queued jobs that sit unworked still alert accurately.
* docs(workmetrics): explain what the images due-only age leaves out
The images queue now reports queued age from due rows only, so a job that
keeps getting deferred (a full artwork store or a missing local mount) no
longer shows as old queued work. Say so in the SiloQueueAgeHigh description
and the workload metrics doc: that case shows as queued depth that keeps
growing, and the images queued age is omitted while every queued job waits
for a later retry.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(catalog): cap effective_io_concurrency during audiobook_group_stats refresh (#5304)
* fix(catalog): cap effective_io_concurrency during audiobook_group_stats refresh
Wrap REFRESH MATERIALIZED VIEW CONCURRENTLY audiobook_group_stats and the audiobook_group_stats_refresh upsert in a transaction on the advisory-lock connection with SET LOCAL effective_io_concurrency = 16.
In PostgreSQL 18, ReadStream prefetching on temporary tables created by concurrent materialized view refreshes can pin all local buffers (temp_buffers) and fail with SQLSTATE 53000 (no empty local buffer available) when the server runs with high effective_io_concurrency. Using SET LOCAL keeps the override scoped to the refresh transaction without leaking to pgxpool while keeping the session-level advisory lock held across the transaction.
* fix(catalog): only lower effective_io_concurrency for the refresh
Raising a lower setting to 16 undid an operator's tuning, such as the
value Silo's own tuning picks for spinning disks, and PostgreSQL 17 and
older reject any nonzero value on platforms without posix_fadvise.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(collections): ignore a query or fragment on an MDBList list link (#5314)
* fix(collections): ignore a query or fragment on an MDBList list link
NormalizeMDBListURL appended /json to the whole string, so a link with a
query or fragment became ".../list?sort=rank/json". The path never ended in
/json, mdblist.com answered with the HTML list page, and the sync failed with
"invalid character '<'". Drop the query and fragment first, and match a
trailing /json in any case. A collection that already stored such a URL
recovers on its next sync, which normalizes the stored URL again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(collections): keep an MDBList link's query for the feed
The first version dropped the whole query, so a feed link such as
".../json?sort=imdbpopular&sortorder=asc", which synced in that order
before, lost its sort. Put /json at the end of the path and keep the
query; drop only the fragment, and the "/json" earlier builds appended to
the end of the query.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(collections): make MDBList link normalization stable on a second pass
Trim every trailing /json from the query, not just one, so normalizing a
stored URL again leaves it unchanged. A Discover row now removes /json
from the path of the feed URL rather than from its end, so a row with a
query stores the list page link.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(collections): trim space a removed MDBList fragment or /json leaves
Trimming before cutting the fragment left the space in "…?sort=rank #top"
for the next pass to remove, so normalizing the stored URL again changed
it. Trim after each cut.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* perf(insights): optimize cold SQL queries across Insights tabs (#5307)
* perf(insights): optimize cold SQL queries across insights tabs
- Add media_item_libraries(first_seen_at, content_id) index and pre-filter
added title candidates before aggregating MIN(first_seen_at), querying
added titles once per Library read and reusing them across later first
plays, in-memory first-play wait bucketing/median, and unplayed lookup.
- Deduplicate admin_playback_history.media_item_id before joining episodes
in Library coverage and replace 4x COUNT(DISTINCT) GROUPING SETS sorts
with hash-aggregated per-library and distinct-title summary queries.
- Omit the media_files join from viewingRowsSQL when libraryID == 0 and
the caller does not project file library attribution.
- Consolidate Devices summary + breakdowns (4 queries -> 1) and subtitle
usage (3 queries -> 1), and pre-group sessions by media file before
probing media_files and JSONB track fields in resolutions, audio usage,
and client-codec matrix.
* fix(insights): keep the unplayed list's tie order and the median's rounding
The recently added, not played list sorted titles added at the same moment
by the database's default collation, because its ids came from unnest. On a
database whose default is not C, tied titles came out in a different order
than the catalog's COLLATE "C" gave before, and a tie at the 20-row cut could
change which title made the list. Go sorts strings byte by byte, as "C"
does, so cut the list there and order by content_id COLLATE "C".
The median of an even number of waits used (lo+hi)/2, which can differ in
the last bit from percentile_cont's lo + (hi-lo)*0.5 and tip the shown value
across 0.1 day. Use PostgreSQL's formula.
Also fold the duplicated title-plays statement into one template and drop a
test that only checked SQL text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* perf(insights): read the Devices tab in three statements instead of eight
Each Devices section scanned the window's sessions on its own, and the
matrix, resolution and audio sections each looked up every played file
again. Read them in three statements:
- one scan feeds the summary and breakdowns, adaptation reasons, protocol
buckets and subtitle usage through grouping sets, and runs the Jellyfin
client check once per bucket and client name instead of once per session;
- one join of the sessions to their files feeds the codec matrix,
resolutions and audio usage through grouping sets, with no CTE under it so
the scan and join can run in parallel, and the matrix ranking stays in SQL;
- client versions stays on its own, since its order and limit rely on the
database's collation, and checks the client tokens after grouping.
The Go post-processing is unchanged, moved into small tallies.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* perf(insights): hash Activity's distinct counts and probe one library's titles
Activity's summary and buckets counted distinct accounts and profiles with
COUNT(DISTINCT), which sorted every session in the window. Count them from a
pre-grouped set of who played in each bucket so every aggregate hashes.
Library coverage collected every title any session ever started, across the
whole history, to count titles never started. With a library filter and no
account or profile filter, probe the history's item index per title of that
library instead; the whole catalog and one account's sessions keep the
collected set, which is faster for them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(insights): match main on fractional-second waits and every catalog
- Compute a title's wait for its first play from the whole microsecond
difference in one division, the float PostgreSQL's EXTRACT(EPOCH ...)
gave. Adding seconds and fractions as two floats could tip the shown
median by 0.1 day for titles added on a fractional second.
- Map sessions to titles in the per-library "never started" probe exactly
as the collected set does: an episode's sessions start its parent
whatever the parent's type, and empty item ids start nothing.
- Read a Devices session's audio track in the projection, after the window
and library filters, so the default-track cast never runs on a file the
filters drop.
- Key protocol buckets by their start rather than their date label.
- Cover the unplayed list's 20-title cut in its tie-order test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* refactor(insights): keep the Devices reads within the linter's function length
Move the two Devices statements into SQL templates with small builders, the
session statement's row handling into a tally like the other three, and the
file statement's row kinds into constants the SQL and the Go switch share.
The SQL and its results are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* perf(insights): serve cached tabs while they refresh in the background (#5321)
* perf(insights): serve cached tabs while they refresh in the background
On a server with steady playback, every playback session change cleared
every cached Insights tab, so nearly every tab load ran its full read, which
takes seconds on a large library.
A playback event now only marks the cache stale. A read serves a stale entry
up to 30 minutes old at once and starts one background refresh of its key, at
most every max(15s, 4x the read's cost). A sweep keeps keys read in the last
30 minutes warm, refreshing stale ones every max(2m, 10x cost), and drops
keys nobody read. Background refreshes run one at a time, so they hold at
most one read-gate slot.
Admin events (account, item and node changes) still drop every entry, and a
read that started before one publishes nothing, so an admin's change shows
on the next read. The Refresh button's refresh=true read waits for fresh data
for its own tab and marks the others stale.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(insights): bound the cache's background reads and keep Refresh fresh
- A background refresh no longer brings back a key the sweep evicted, or
an admin change dropped, while it waited or ran.
- A refresh that fails is retried no sooner than one that succeeds would
be, and a slow failure counts toward the key's cost, so a read that keeps
timing out can't hold a read slot back to back.
- The sweep keeps a key warm for five minutes after its last read instead
of thirty, so background reads stop soon after the Insights page is
closed. A key is still served for thirty minutes.
- Invalidate, which admin events and the Refresh button call, drops every
entry again, as before this branch; only playback events mark entries
stale. Switching tabs after Refresh no longer shows pre-refresh numbers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(insights): cap the cached Insights reads at 128 per server
Entries now live up to 30 minutes instead of a minute, and their keys
multiply across ranges, timezones, filters and parameters that an
admin:monitor API key can ask for at will. Cap the cache at 128 entries and
let a new key evict the entry read longest ago, which also bounds how many
keys the sweep can keep refreshing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(insights): keep the cache's background reads to what still needs one
- A refresh that queued for the single slot rechecks, once it gets it,
that its entry is still the key's (not dropped, evicted or replaced),
still stale, and, for the sweep, still in its warm window. Its retry
spacing counts from when it reads, and a failure is charged only to the
entry it read for.
- The sweep refreshes only keys an event changed; one that is merely
older than a minute refreshes when someone reads it, so an idle server
reads nothing in the background.
- Misses share one read across playback events, which only mark entries
stale; only Invalidate starts a new one.
- Invalidate cancels a background refresh it would discard, freeing its
read slot.
- The dashboard's Refresh button now asks for fresh Insights too, as the
Insights page's does, instead of getting the cached copy.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* docs(insights): rewrap the cache provider's doc comment
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(insights): keep Refresh to its own read and serve no copy over 10 minutes
- A refresh=true read no longer drops the whole cache. It marks every
entry stale and waits for fresh data for its own key, so a Refresh on
the dashboard or one Insights tab no longer costs every other tab its
cached read, and a burst of refresh reads no longer discards each
other's fills. Admin events still drop every entry.
- Serve a cached copy at once only while it is under ten minutes old, and
drop keys nobody read for ten minutes. A tab someone is browsing stays
warm; one opened after a longer break, a slow dashboard poll or an API
client waits for fresh data, as before this branch, so changes no event
announces (a library scan, the window moving) show up.
- Cap the background refreshes waiting for the single slot at eight; a
waiting one keeps its entry alive even after eviction.
- Only the dashboard's Refresh button asks for fresh Insights; returning
to the page catches up from the cache.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(scanner): read the hearing-impaired subtitle flag from the stream disposition (#5290)
FFprobe reports a subtitle track's hearing-impaired flag under disposition,
but the scanner looked for it in the stream tags and the decoded disposition
had no field for it, so every embedded track was stored as not
hearing-impaired.
Closes #5222
* fix(web): clear the subtitle upload selection when a file is rejected (#5291)
* fix(web): clear the subtitle upload selection when a file is rejected
Choosing an unsupported file in Add Subtitles showed the error but kept
the earlier file selected, so Upload sent a file other than the one the
error named. The rejection now clears the selection and the detected
language note, and ignores the earlier file's pending detection.
* fix(web): reset the detected language and file input on rejection
A rejected file now also puts back the default language when the earlier
file's language was detected rather than chosen, and clears the file
input so picking the earlier file again still registers.
* fix(web): keep only a user-picked language when a file is rejected
The detector reports a fallback language as manual, so the rejection now
keys the language reset on whether the user picked the language rather
than on the detection source.
* fix(web): reset only a detected language when a file is rejected
The detector reports a fallback as manual, and that fallback is often the
language the user picked. Keying the reset on languageOverride discarded
that choice, so the rejection resets the language only when detection
found it.
* test(web): cover a detection result that arrives after a rejected file
The rejection branch drops any language detection still running for the
earlier file. Add a test where that detection settles after the rejection
and check the language, the detected note, the error, and the Upload button
stay as the rejection left them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Quick <31828688+Quick104@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(playback): put the fonts an ASS script names first in its font bundle (#5293)
* fix(playback): put the fonts an ASS script names first in its font bundle
A subtitle font bundle holds at most 32 fonts and 32 MiB. Releases that
attach more fonts, often in alphabetical order, lost the ones the script
uses because the bundle kept the first attachments in container order.
When the attachments do not all fit, the bundle now reads the font
families the selected track names (style Fontname values from the track
header in the source's index, and \fn overrides once the subtitle cache
holds the extracted track) and the names inside each attached font, and
takes the matching attachments first. The log line now counts every font
left out.
* fix(playback): bound the font names read from an attachment
A crafted font collection could give each of its directories its own
header over one shared name table full of repeated names, so choosing a
bundle's fonts could decode the table hundreds of times, well past the
extraction deadline. Font names are now read within one budget per
attachment: each distinct name table is read once, every record examined
counts toward 8192 records, a name stored in more than 256 bytes is
skipped, and at most 512 distinct names are kept.
* fix(playback): bound script font names and keep the bundle when names are slow
A script that names a new font in every event made reading its families
quadratic, and each attachment's names were compared against every family:
20,000 distinct \fn names took seconds of CPU and 100,000 took about 24 s,
none of it stopped by the request's deadline. The families are now kept in
a set, at most 256 of them, and matched by lookup.
Reading every attachment's names shared the bundle's 30 s deadline, so on
storage too slow for it the request failed where the base served the fonts
that fit in container order. The name read now gets half of what is left of
the deadline and falls back to container order when it runs out.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Quick <31828688+Quick104@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(web): keep Insights tabs on screen while a sort, search, or filter loads (#5328)
* fix(web): keep Insights tabs on screen while a sort, search, or filter loads
Changing a sort, search, range, or library filter on an Insights tab
dropped the tab's data and showed skeletons until the new read returned.
The tabs now keep the previous result as placeholder data, dim it after
150 ms, and lift the dim when the new result lands. The People search
shows a spinner meanwhile. Links in a dimmed region are disabled, since
they would combine the new filters with the old result's window.
Placeholder data never carries across a change of signed-in profile or
server, and the person and title detail sheets do not opt in, so they
never show another person's or title's numbers. The Titles tab formats
its rows by the sort the data was ranked by, not the toggle's new value.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(web): keep refreshing Insights content opaque and block Enter on its links
Reviewers found two problems with the dimmed placeholder. At 50% opacity,
secondary text fell to about 2.7:1 on the default panel, below 4.5:1, and
no fixed opacity is safe under high-contrast mode or custom branding.
pointer-events also left the stale links reachable with Enter.
The region now stays opaque and shows a sweep along its top edge, which
fades in after 150 ms and holds still under reduced motion. A capture-phase
click guard stops links in the region, which covers Enter as well; buttons
stay live. The People tab uses one region for its KPIs and table.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(web): drop a reset device override from the cached settings list (#5296)
* fix(web): drop a reset device override from the cached settings list
Reset override in the Admin > Devices subtitle appearance editor only
invalidated the user's cached settings list. Until the refetch answered,
a reopened editor still found the deleted row, showed its values, offered
Reset override again, and the next change saved those values back.
Both device override resets now remove the deleted rows from the cached
list before they settle, then refetch. Reset all overrides also removes
the rows it deleted before a later key failed.
Closes #5250
* fix(web): drop each reset-all row as its delete lands
A save made while the rest of a reset-all runs is no longer dropped with
the reset rows, and a key reset before a later failure still leaves the
cache. Covers the partial-failure case.
* fix(web): drop the mirrored intro skip row with its reset pair
The server clears playback.intro_skip_mode and playback.auto_skip_intro
together when either is deleted, but the cached settings list lost only
the key that was reset. Until the refetch answered, Admin > Devices still
counted the companion as an override and offered to reset it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Quick <31828688+Quick104@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(web): keep Find markers on playback in view with on-demand online markers (#5299)
* fix(web): keep Find markers on playback in view with on-demand online markers
Choosing "Fetch when needed" under "Online preferred + server detection"
hid the Find markers on playback row and staged markers.lazy_playback=true,
which turns on local detection at playback. On-demand lookups run at
playback either way, so storage no longer stages lazy playback and the row
shows whenever local detection is on or online markers are stored.
Closes #5251
* fix(web): describe a kept lazy playback row for online-only markers
Under online-only markers the row kept for an unsaved edit fell through to
the local detection description.
* fix(jellycompat): return episodes from favorites and Ids lookups across mixed types (#5297)
* fix(jellycompat): return episodes from favorites and Ids lookups across mixed types
A Jellyfin /Items request for favorites with IncludeItemTypes naming
Episode beside other types went to the media_items favorites browse, and
an Ids lookup with such a type filter (or Episode alone) skipped the
episode browse. media_items holds no episodes, so the favorite or named
episodes were missing from Items and TotalRecordCount.
Favorites now take the mixed browse, and the episode browse accepts the
Ids list, which BrowseEpisodes applies as a content ID allowlist.
Closes #4546
* fix(jellycompat): keep a series or season ParentId on episode Ids lookups
An Ids lookup with IncludeItemTypes=Episode and a series or season
ParentId now reaches the episode browse, which listed the named
episodes of every series. It now keeps only that parent's episodes.
* fix(jellycompat): keep Ids out of /Shows episodes and collection lookups
The episode Ids allowlist was set in the filters /Shows/{id}/Episodes
shares, so an Ids parameter there narrowed the series, which Jellyfin
ignores. Set it only in the /Items episode browse.
An Ids lookup under a collection ParentId reaches the episode browse
before the collection handler, and that browse can't match a
collection's members, so it returned named episodes outside the
collection. List no episodes there instead.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* docs(jellycompat): say a collection ParentId drops only the named episodes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Quick104 <31828688+Quick104@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(web): stop the Add widget sheet from scrolling the dashboard behind it (#5344)
The Add widget sheet is non-modal so the grid stays a drop target, which
also means nothing locks page scroll. Wheel input over the sheet header,
over a list too short to scroll, or at either end of the list scrolled the
dashboard. A non-passive wheel listener on the sheet now cancels wheel
input the widget list can't take; the list still scrolls natively while it
has room, and Ctrl+wheel zoom is left alone.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(playback): show a confirmed pause in the admin session views at once (#5298)
A pause or resume a native player confirms over its control socket now moves the session's lifecycle row before the sync that cues admin monitors, and announces session.paused or session.resumed. The admin session list and Live activity show the confirmed state at once instead of after the next progress report. The web session cache applies those events by lifecycle number and keeps them over an in-flight list read.
Closes #5224
Co-authored-by: Quick <31828688+Quick104@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(admin): translate the source of a catalog import from an export job (#5206)
* fix(admin): translate the source of a catalog import from an export job
The server stored an import's source only as the English text
"Export job <id>", so the web showed it untranslated. Imports queued from
an export job now also record the export job ID, GET /api/v2/admin/jobs
returns it as source_export_job_id, and the web formats the label with a
catalog key. source_label is unchanged for older clients.
* chore(i18n): pin translations to release 2026.11.24-dfd3991
Re-pin the web catalog from the unreleased silo-translations#162 commit
to the published release that contains it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Quick <31828688+Quick104@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(web): let a task's run history scroll sideways on phones (#5122)
* fix(web): let a task's run history scroll sideways on phones
The run history table sat in a panel that clipped it, so on a phone the
Error column was out of reach and its text was cut to one line with the
full message only in a tooltip. The table now uses the shared scrolling
table container, like the due samples table on the same page, and the
Error cell wraps at every width.
Closes #4690
* fix(web): wrap long tokens in the task history Error cell
A path or identifier with no break opportunity ran past the cell and gave
the table a sideways scrollbar, at desktop widths too. The 12rem minimum
also applied to empty cells, so a history with no errors scrolled
sideways on a phone onto an empty column. Wrap anywhere, and keep the
minimum width for cells that show error text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Quick104 <31828688+Quick104@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(settings): read the profile subtitle appearance in the effective route (#5292)
* fix(settings): read the profile's subtitle appearance in the effective route
GET /api/v2/settings/subtitle-appearance/effective resolved the legacy
subtitle_appearance rows, so a profile that saved its appearance through
playback.subtitle_appearance (what the web, Apple and Android clients write)
got empty global_value and effective_value. Read the canonical rows instead:
the profile_device override for the declared device over the profile-scope
value, the contract's resolution order.
The legacy two-level resolver had no other caller and is removed.
Closes #5223
* fix(settings): refuse subtitle overrides the canonical schema cannot hold
The companion PUT /api/v2/settings/device/subtitle-appearance accepted any
JSON and, when the value failed subtitle-appearance.json, stored it only in
the legacy row. Now that the effective route reads the canonical rows, such a
write answered 200 while the response kept the previous override. Refuse it
with 422 at body.value, as PUT /settings/values does.
The effective route also reports the device name and platform the override
was saved with again, so a GET that declares only the device id keeps them.
* docs(settings): drop retired v1 routes from device-override comments
* docs(settings): say jsonb reorders keys in the compact-JSON helper's comment
compactSettingJSON strips the spaces Postgres jsonb adds, but jsonb also
reorders object keys while SQLite keeps them as sent, so the two backends
do not always return the same string for one document.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Quick104 <31828688+Quick104@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(intromarkers): store a credits tail with no video frame as sparse (#5294)
* fix(intromarkers): settle a credits tail without keyframes as sparse
A tail pass that ran cleanly but decoded no keyframe was stored as a
retryable failure ("credits tail pass parsed no keyframes"), so files
whose video ends before the tail window, or whose window holds no IDR
frame, were decoded again on every backoff and never settled.
Treat that run like any other tail with too few keyframes: store it as
unusable with detail sparse, for episodes and movies alike, so it is not
decoded again until the file changes.
Closes #5260
* fix(intromarkers): store a tail as sparse only when ffmpeg counted no frame
A tail pass without parsed keyframe statistics is now stored as sparse
only when ffmpeg's own progress count says the window gave no video
frame. When ffmpeg counted frames the log parsers did not read, or
reported no count (an older remote node), the pass still fails and is
retried, so a log format change cannot settle every tail as sparse.
mediasample.Result gains VideoFrames, ffmpeg's frame count for a Stats
output, read from its last progress line.
* fix(intromarkers): keep the fingerprint when only the tail is unread
A tail pass whose keyframes ffmpeg counted but the log parsers did not
read fails the tail alone again, so the credits fingerprint from the same
run is still stored. The progress count also reads a line that starts with
the color reset ffmpeg writes when it colors its log, and the committed
worker schema gains Result.video_frames.
* test(mediasample): pin the progress frame count parser
* docs(intromarkers): say where a missing frame count comes from
Tail passes always run on the server's own ffmpeg, so a missing
VideoFrames count means ffmpeg printed no progress line, not that an
older remote node answered. Also give the real-ffmpeg tail test the
comment CONTRIBUTING asks of a test that takes over a second.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Quick <31828688+Quick104@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(web): name each Edit Metadata lock toggle after its field (#5295)
* fix(web): name each Edit Metadata lock toggle after its field
Every padlock button in Edit Metadata had the same accessible name, its tooltip, so a screen reader could not tell which field a button locks or whether it was locked. Each toggle is now named "Lock <field label>" and reports its state with aria-pressed. The tooltip stays.
The new web.item.editMetadata.lockField string comes from a local silo-translations build until its catalog change has a release.
Closes #5163
* chore(i18n): sync the lock toggle name in every language
Re-sync the web locales from Silo-Server/silo-translations#175 after its
translation pass, so every shipped language carries
web.item.editMetadata.lockField. The pin is still a local build; it moves
to the published release once that pull request merges.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* chore(i18n): pin translations release 2026.11.25-e50eaa0
Silo-Server/silo-translations#175 merged and published 2026.11.25-e50eaa0.
Re-sync from that release in place of the local build; the locale files
are unchanged, so only the pin and the generated header move.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Quick <31828688+Quick104@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(web): keep profile and library names in their own order in right-to-left languages (#5231)
The profile editor's avatar preview and the restricted-library list rendered
user-entered names in the page's direction, so in Arabic a name like
"56 Days, Season 1 (Extended Edition)" moved its leading digits away from the
start. Give both names dir="auto", and the library name align-with-page so its
wrapped lines stay on the page's start side.
Closes #5055
* fix(web): draw readable badge text when the fill is see-through (#5226)
* fix(web): draw readable badge text when the fill is see-through
Vibrant badges without an accent kept their black text when Look -> Fill
was None, so 4K, HDR and audio labels were drawn black on the artwork.
Presets that draw a fill now get white text on any see-through fill, and a
see-through fill adds Minimal's text shadow when the preset has none.
Closes #4922
* fix(web): keep the see-through text shadow off when shadows are off
Look -> Shadow -> No shadow now also leaves out the text shadow a
see-through fill adds, and the style tests keep one case per branch.
* fix(web): keep the see-through text shadow off Plate's source chips
A see-through fill gives Plate badges a text shadow, and the source chip
inherited it onto its own solid colour. The chip now draws no text shadow.
The applyOverlayStyle comment now names the presets that get white text
(those that fill with the accent), and the card overlay architecture doc
records the see-through text colour and shadow rules for the other clients.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Quick <31828688+Quick104@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(web): keep Signed-in sessions buttons inside the card at large text sizes (#5227)
* fix(web): wrap session row buttons inside the card at large text sizes
On a narrow screen with a large font, the sign-out and Details buttons on a
Signed-in sessions row ran past the card's edge and the sign-out label was
cut off. Let the actions group wrap and let the sign-out label wrap within
the card's width.
Closes #4975
* fix(web): let the session row Details label wrap too
A long Details label (Czech "Podrobnosti") at a 200% font still ran past
the card on a 300px screen. Give both row buttons the same wrapping classes.
* fix(web): wrap long matcher queue paths instead of widening the desktop table (#5228)
* fix(web): wrap long matcher queue paths instead of widening the desktop table
The expanded library row in the desktop matcher queue kept the table's
whitespace-nowrap, so a long path grew the cell and the table scrolled
sideways with the filename off-screen. The cell now wraps and the path
uses CardPath on both layouts, as the expanded skipped-root row does.
* fix(web): keep matcher queue badges on a wrapped path's first line
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Quick <31828688+Quick104@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(web): keep week strip weekday labels inside their buttons on phones (#5230)
Below the md breakpoint, locales whose short weekday names run past four
characters (pt-PT, sw, lv, pl, ar, da) show narrow names in the Calendar
week strip, so labels no longer overlap their neighbours. Each button's
accessible name keeps the short name.
Closes #4886
* fix(web): let Bolder text weight reach prefixed weight classes (#5232)
* fix(web): let Bolder text weight reach prefixed weight classes
Under Bolder, app.css raised the bare font-normal, font-medium,
font-semibold and font-bold classes with !important rules. Tailwind gives
a prefixed class such as focus:font-medium its own selector, so the skip
links and file-input buttons stayed at their Default weight.
Redefine Tailwind's --font-weight-* theme variables under Bolder instead.
Every weight utility reads them, whatever its prefix, and the
!important rules go away.
* fix(web): keep card overlay badges following Bolder text weight
Badges set their weight inline, which the removed !important class rules
used to override under Bolder. Without them the badges stayed at their
Default weight. Resolve a badge's weight through the theme's weight
variables so Bolder moves it up a step like the weight classes.
* fix(web): keep the time range together in dashboard chart titles (#5233)
* fix(web): keep the time range together in dashboard chart titles
A narrow dashboard card wrapped "Playback activity · last 24 h" inside the
range ("· last" / "24 h"). rangeTitle now joins the translated range with
no-break spaces, so the title can only wrap between the widget's name and
its range, in every language.
Closes #4882
* fix(web): let the API clients header wrap like the other dashboard widgets
The API clients card kept its own header that never wraps, so a longer
range title such as Czech "· posledních 30 d" pushed the range picker past
the card edge at 1024px. It now uses WidgetHeader. rangeTitle splits on the
nearest spaces instead of a regex lookbehind, which older Safari lacks.
* test(web): carry the Arabic and Japanese range titles inline
CI's web test job checks out only the English locale catalogs, so the
range title test could not import ar.json and ja.json.
* feat(catalog): label sports episodes by air date (#5129)
* feat(catalog): label sports episodes by air date
Sportarr numbers a league's events S<year>E<n> so they sort as a TV season;
the numbers mean nothing to a viewer. A metadata provider can now mark a
series episode_labels=air_date. The server stores it on the series
(media_items.episode_labels) and v2 returns it on cards and item detail,
with air_date on episode cards. The web app shows the episode's air date
where it showed S2026E296.
* feat(catalog): carry air-date episode labels to listings and the player
Review follow-ups: Identify clears a stale episode_labels; listing cards
(browse, search, collections, favorites, watchlist, history), watch detail,
the player HUD, Playing Next and Watch Together pickers label date-labeled
episodes by air date; the contract is documented in docs/catalog-api.md.
* fix(catalog): clear air-date labels on Identify and label shuffle and pickers
Round-2 review follow-ups: Identify drops a stored episode_labels even when no
trusted ID differs (a Sportarr league has none); the shuffle post-roll, the
On Deck line and the Watch Together pick use the air date; a watch-detail
contract test; shared airDateWithTitle helper.
* fix(catalog): project episode_labels in the episode catalog source
The episode catalog source builds media_items-shaped rows for episode browse,
search and custom sections; it lacked the new column, so those queries failed
with 'column mi.episode_labels does not exist'.
* refactor(catalog): carry episode labels on listing cards without a second query
Listing cards take episode_labels and the episode air date from the rows
they already load (item list shell, favorites/watchlist/history builder,
collections, and the episode catalog source's series join), so the
per-listing label lookup and its apiv2 plumbing go. Also: one shared
section ID collector, a single date/title separator on web, a plain
labelsEpisodesByAirDate(labels) signature, and the Identify comment moved
off the correction block.
* fix(catalog): label episode cards in row-backed listings and smart collections
Explore All pages of home rows and episode-scoped smart collections lost
the episode's air date (and the rows their label) once listing cards stopped
using a separate lookup. Episode card contexts now carry the series' label
and the air date, which covers every catalog listing; collections take the
air date from the episode row. Also moves the label helpers out of
media.go (size ratchet) and uses the item type constants.
* test(catalog): pin episode labels on listing episode cards
* fix(catalog): bound episode label lookups and keep party subtitles English
- Episode label lookups dedupe content IDs and query them in batches of
500, so a large section page no longer sends one unbounded ID list.
- The Watch Together episode picker passes the fetched series' episode
labels into the staged pick when the card it opened from has none, so
the suggestion names a date-labeled game by its date.
- The subtitle sent to a Watch Together party writes the air date in
English, since it is data other viewers read.
* style(web): format episodeSubtitle
* fix(web): show the game's date in the Watch Together episode list
For a date-labeled series the episode picker rows showed the synthetic
episode number ("296."). They now show the game's air date, and undated
rows keep the number. The rows, the staged pick and the confirmation
footer read the series' labels from one place: the card, else the
fetched series detail.
* fix(catalog): carry episode labels on browse, picker and synthetic season cards
Series cards from catalog browse and search, Watch Together picker cards,
Watch Tonight and recommendation cards, and synthetic season detail dropped
the series' episode_labels, so clients showed S2026E296 there. The Start
Party episode chooser now names a date-labeled game by its date. The API
docs tell clients to treat an unknown episode_labels value as numbers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(catalog): label Watch Tonight, recommendation and Explore All cards from the section loaders
The section fetcher's own column list and its episode-target query never
selected episode_labels, so Watch Tonight, recommendation rows, Explore All
of fetcher-backed rows and the admin section preview sent cards without it.
Home sections hid the gap with a separate per-request lookup.
Select the column in both loaders, derive an episode card's air_date in the
shared card builders (sectionItemFromMediaItem, applyEpisodeCardMeta), and
drop the separate EpisodeLabelReader lookup, which every home load paid for.
Web: the Continue Watching and On Deck date lines pass their parts as an
array: Children.map does not look inside a fragment, so the date lost its
non-shrinking box; an untitled dated episode's image alt and menu title use
its date instead of "Episode 296".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(catalog): send an admin preview episode card's air date with its label
The admin section preview copied episode_labels onto ep…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enhancementNew feature or requestgoPull requests that update go codejavascriptPull requests that update javascript codepriority: P2Limited scope, workaround exists, or polishsize/XXXL3000+ added + deleted lines (all files); change volume, not priority.stackedBase is another open PR; merge in stack order named in the body
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Related issue: N/A
Validation tasks: none
Other clients: Apple N/A (admin web only; no client reads these endpoints); Android N/A (admin web only); Roku N/A (admin web only)
Insights (#5269) shows admins how their server is used, but none of its charts can go on the dashboard, and the dashboard's Top titles and Most active profiles count finished plays while Insights counts plays, so the two disagree. Insights also can't yet say which days and hours are busiest, how many people watch in each period, how sessions end, which app versions are in use, how subtitles and audio tracks are used, or how much of each library anyone watches.
This PR:
Approach
useDashboardLayoutas the dashboard, so an add goes through its revision-checked save. The dashboard now waits for a layout save that is still running, and for the refetch after it, before adopting the server copy; without that, opening the dashboard right after an add showed the layout from before it.titlessorted by plays, and a newpeople.top_profiles), so they match the Titles and People tabs. Insights windows start at 7 days, so these two widgets lose the 24-hour window, and one saved on 24 hours opens on 7 days.getAdminDashboardTopActivitystays because monitoring API keys may read it; only the web app stops using it.active_accountsandactive_profilesper bucket, andend_reasons(sessions by how they ended).least_finished, titles with at least 3 plays and at least one left unfinished, ranked by the share finished.top_profilesacross all accounts.client_versions,protocol_buckets(Silo apps vs Jellyfin-protocol apps per period),subtitlesandaudio. Subtitles and audio count only sessions with route facts, which feat(admin): add playback Insights and rework Playback History #5269 started recording.GET /api/v2/admin/insights/library(getAdminInsightsLibrary), advertised by thelibrarycapability, open to monitoring keys and cached like the other Insights reads, including feat(admin): add playback Insights and rework Playback History #5269's cancellation of a fill no request still waits on. For movies and series, per library and in total, it reports the share played in the window, titles never started, titles added in the window and how long they waited for a first play, plays by genre, release decade and content rating, and the newest titles added and not yet played. Window counts use only the window's plays, like every Insights read. "Never started" and "not played yet" describe today: for a window that ended in the past, a second pass groups only the sessions of the titles it added that had no play in it, from the window's start to now. It is a report; nothing acts on files.lgwith no scrollbar, fades the edge that has more tabs past it, and keeps the active tab in view, using the sameuseScrollStripas the user detail tabs.docs/admin-api.mddocuments every new field and the Library read.2026.11.25-dbc5ec8.Validation
Rebased onto
mainafter #5269 merged. The full gate ran on the rebased branch at 5deeb63; the review fixes after it were checked with the handlers and apiv2 packages against a freshly migrated database,make lint-changed, the v2 contract checks, the web typecheck, lint and format, and the Insights and i18n tests.go mod tidy -diff,go vet ./...,make lint-changedandmake lint-router-recovery(0 issues),make test-go: pass.main(no breaking change), committed artifact, local paths, case collisions, fork pins, settings bindings, playback fixtures, migrations, size ratchet, bidi: pass. Not run: actionlint, ShellCheck and the Prometheus rules check; this PR changes no workflows, shell scripts or alert rules.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/insights-dashboard-followups/
Surface and build: web admin dashboard and Insights, desktop and phone width, on seeded demo data. Before is #5269's head (22d20f9); after is a5cb25d, with the dashboard, Add to dashboard and Library captures retaken on 4fdd358 after the first review fixes, and the phone tab row captured before (5deeb63) and after (31dc48f).
Risks
/api/v2.Checklist
AI Disclosure
🤖 Generated with Claude Code
Note
Add Library tab, Insights dashboard widgets, and breakdown endpoints to admin Insights
GET /api/v2/admin/insights/library) with catalog coverage, genre/decade/rating breakdowns, first-play timing, and recently added unplayed titles, backed by a TTL cache in admin_insights_cache.goAddToDashboardButtonso Insights cards can pin widgets with a matching rangeTopTitlesWidgetandTopProfilesWidgetwith the Insights Titles and People queries, and removes theuseAdminTopActivityhook and its API typesuseDashboardLayoutto not adopt a remote server layout while a fetch or layout write from another page is in progressrangeDaysexportMacroscope summarized 9e46281.