Repository navigation
feat(settings): expose common regional language tags - #1071
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Too many files changed for review (3000 files, 100 file limit). |
|
Important Review skippedToo many files! This PR contains 2998 files, which is 2898 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. Usage-priced reviews support at most 300 files. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (2998)
You can disable this status message by setting the |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 63f9abf81e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| { "value": "zh-Hans", "introduced_in": 8 }, | ||
| { "value": "zh-Hant", "introduced_in": 8 }, |
There was a problem hiding this comment.
Advance the manifest revision for the new choices
These options are marked as introduced in revision 8, but the parent manifest was already revision 8 and this change leaves that number unchanged. Clients filter vendored options with introducedIn <= manifest_revision, so a new client connected to any previously released revision-8 server will incorrectly treat these choices as part of that server's contract, while revision-based contract consumers cannot distinguish the two manifests. Bump the manifest to revision 9, mark the additions as introduced in 9, and regenerate the bindings.
Useful? React with 👍 / 👎.
PR #1071 on apiv2 regenerated web/src/lib/settingsContract.ts without the prettier pass the settings-bindings target runs, so the Web format check failed for every branch rebased onto it. Regenerate through the target; the content is unchanged. Co-Authored-By: Claude Fable 5.1 <[email protected]>
* feat(web): redesign the setup wizard The first-run wizard was nine generic cards in a fixed order with a dead profile step, a "Server & storage" page that mixed Redis, playback, the Jellyfin web installer, and two S3 buckets, no way to name the server or set its public URL, a bare hardware-acceleration dropdown, and a library form with twenty decisions. Progress lived only in browser storage and /setup stayed reachable forever. Rebuild it as eight steps on a labelled step rail: Account, Server, Playback, Storage, Libraries, Subtitles, Connect apps, Features, Done. Finished rungs record what was chosen and can be reopened. Steps use the admin settings row primitives so setup and administration read as one product. Server name, public URL, and trusted proxies get their own step; Playback shows the detected GPU and both HDR tone-mapping toggles; Storage reports Redis and S3 as status rows and detects an environment-managed Redis; Libraries only asks for name, type, and folders, with edit and delete; subtitle providers save in one Continue; the Jellyfin web installer and worker nodes leave the wizard. Account creation selects the default profile in the same render so the next step lands drawn rather than as a skeleton. A new setup.completed server setting is written from the final screen and reported on the public setup-status endpoint as an additive wizard_completed field; the web client redirects /setup to the admin area once it is true. A migration sets the marker for every install that already has an account. Every path that stores an account or notification address now shares one email rule (auth.ValidateEmail): a single bare mailbox with a dotted domain, so "admin@siloserver" is refused on setup, signup, admin account writes, invitations, and the profile notification address. The web forms apply the same check before sending. The wizard's storage step also gains the Cloudflare token fields the admin page already had (#325). Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(web): address setup wizard review findings Persist setup.completed before clearing local progress and navigating, so a failed write keeps the admin on the Done step with a retry instead of reopening an empty wizard. Read setup status and the provider list independently at boot so a failed provider fetch cannot blank the completed flag. Hold the account step until a profile is selected, retry the profile lookup from the wizard when the one made during account creation fails, and offer profile creation for an account that has none. Reload a subtitle provider's validator after every save attempt so a retry never sends a stale If-Match. Tie connection-check results to the values that were tested so editing a field clears a stale green result. Keep the stricter email rule on v2 transports only; the frozen v1 setup, signup, and admin account routes keep their previous acceptance. Match the client literal-domain check to what net/mail accepts. Fix the import grouping in the auth service and make the migration's down step a no-op, since a backfilled marker cannot be told apart from one the wizard wrote. Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(web): finish setup wizard review follow-ups Apply the strict email rule to v2 invitations in the transport, and restore the previous net/mail acceptance in the shared invitation service and the v1-only notification address, so no frozen v1 route changes behaviour. Gate the wizard's library read on a selected profile like its other acting-admin reads. Keep a subtitle provider's test result only while the draft still matches the credentials it tested. Co-Authored-By: Claude Fable 5.1 <[email protected]> * chore(web): format the generated settings bindings PR #1071 on apiv2 regenerated web/src/lib/settingsContract.ts without the prettier pass the settings-bindings target runs, so the Web format check failed for every branch rebased onto it. Regenerate through the target; the content is unchanged. Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(web): close remaining setup wizard review gaps Compare the whole connection-check request, dirty keys included, so a staged secret clear does not keep an older success. Drop a cancelled subtitle editor read from the loaded set so the next list refresh can issue it again. Ask before a rail click discards unsaved edits, since the setup route mounts no router guard. Disable Continue on the library step while an editor is open. Send an admin whose profiles are all PIN-locked to the profile picker with a redirect back to setup. Co-Authored-By: Claude Fable 5.1 <[email protected]> --------- Co-authored-by: Claude Fable 5.1 <[email protected]>
* fix(playback): retain font serving grants through response completion * fix(playback): stop client mutations after administrator revocation * fix(playback): retire start replies received after unmount * fix(playback): require the exact durable stop receipt identity * fix(api): preserve empty subtitle inventory arrays in v2 * fix(apiv2): accept embedded font stream pins * test(playback): capture admission before reconciliation reservation * feat(playback): wire initial distributed execution and egress * fix(audiobooks): fence ABS playback at first admission * feat(playback): retain fenced successor route lifecycle * fix(playback): recheck replacement owner after lock waits * fix(playback): serialize projection against candidate staging * feat(catalog): resolve trusted singleton audiobook timelines * feat(catalog): resolve complete persisted audiobook groups * feat(playback): grant retained candidates execution authority * chore(apiv2): generate bound playback timeline contracts * feat(playback): join bound timeline runtime and terminal part barrier * feat(playback): bind audiobook sessions to server timelines * fix(audiobooks): resolve chapter intents through bound timelines * fix(playback): validate retained bound timeline refusals * fix(playback): support the configured property-check target * fix(audiobooks): preserve play intent through part transitions * feat(playback): add proxy auxiliary producer transfers * fix(audiobooks): await terminal stop before replacing the player * fix(proxy): allow auxiliary profile selector in preflight * feat(playback): replace bound routes for captured seek intents * fix(playback): release confirmed cancelled seek blockers * feat(playback): admit bound video HLS remux producers * fix(player): scope proxy subtitle requests to captured authority * fix(player): discard subtitle carryover after authority loss * feat(playback): retain admitted progressive remux producers * test(web): keep subtitle regression compatible with TypeScript target * feat(playback): join proxy auxiliary startup and captured URLs * chore(api): refresh playback auxiliary contract artifacts * fix(api): preserve strong validators through reverse proxies * fix(api): declare identity encoding for versioned responses * fix(playback): project bound media for header-authenticated clients * fix(playback): admit header-authenticated typed font requests * chore(api): regenerate header-authenticated media contracts * wip(playback): checkpoint terminal owner-loss recovery * feat(playback): recover terminal sessions after API owner loss * fix(playback): restrict pending recovery schema to draining replies * fix(api): preserve playback response schema compatibility * chore(api): regenerate owner-loss recovery contracts * fix(web): settle lost playback owners without automatic continuation * fix(web): require recovery proof for owner-loss decisions * test(web): retain bound journals without owner-loss proof * fix(playback): record safe initial abort diagnostics * fix(playback): classify frozen preparation policy rejection * fix(api): honor trusted proxy scheme for websocket origins * fix(playback): select executor GPU before freezing recipe * fix(playback): resolve completed initial startup aborts * test(playback): keep abort replay mismatch request valid * test(playback): match expired owner abort receipt identity * refactor(playback): enable v2 runtime by default * fix(playback): provision default source admission * fix(playback): admit v2 sources through retained authority protocol Retain automatic admission intents and apply the existing first-admission transition during capability discovery or first start. Preserve identity checks, receipt replay, and blocked or retiring source fences. Exclude progressive remux from bound-runtime planning, add bounded authority diagnostics, and provide guarded recovery for unused unreceipted bindings. Update regression coverage, API route inventory, and playback documentation. Validation: focused Go packages, PostgreSQL integration tests, admission race tests, route inventory, migration and local-path checks passed. Browser HLS playback, pause/resume, durable STOP, and retained-start recovery passed. Full repository lint and test gate not run. * fix(tonemap): probe hardware decoders with a real Main 10 fixture (#1006) (#1007) The 256x256 decoder fixture introduced for Pascal NVDEC was encoded with general_profile_idc 4 (Rext) although its pixel format is yuv420p10le. Intel VAAPI and QSV decoders refuse Rext with "No support for codec hevc profile 4", so every hardware tone-map smoke failed and no Intel node advertised a hardware tone-map capability. Playback then chose software tone mapping, which forces the software encoder, so HDR sources were CPU-transcoded on nodes whose GPUs handle them. Software decoding accepts Rext, so the software smoke kept passing and the regression was invisible in the capability inventory. Replace the fixture with a 256x256 HEVC Main 10 frame (profile_idc 2) and add a test that parses the SPS so the profile cannot drift again. Related issue: #610 (cherry picked from commit dc887b3c567303ca5554e3a1101d2dd6324345a4) Co-authored-by: Claude Fable 5.1 <[email protected]> * refactor(playback): replace distributed authority with sequenced v2 progress and stream deny (#1005) * fix(playback): reconcile failed starts and retry retained requests * refactor(playback): replace distributed authority with sequenced v2 progress and stream deny The apiv2 branch layered source admission, owner leases, activation phases, per-response serving grants, route replacement, transfer permits and a browser-side durable journal onto playback. It broke the v1 bridge: v1 progress and stop demanded sequence and stop_id, so Apple and Android got 400. Remove all of it. v1 routes return to main's handlers and bodies. v2 keeps the installation check, sequenced progress and stop on the attempt row via a compare-and-set on last_sequence and stopped_at, and a Redis stream-deny marker written on stop, expiry, abort and admin terminate and checked on every API, proxy and transcode-node serve path. Replan delegates to the v1 application. The web player starts through a small startPlaybackV2 and reports in-memory sequenced progress with one stop_id; audiobooks return to main's flow on top of the v2 helpers. One migration drops the seven authority tables and control_* columns and adds last_sequence, last_sample, stopped_at, stop_id and stop_receipt. Related issue: #135 Supersedes #1002. Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(playback): close the review gaps in sequenced stop, expiry, and media ownership Review of the simplification found the row compare-and-set was not enough on its own: - Progress side effects ran after the CAS unordered, so an older sample could overwrite a newer one in the live session and the saved resume position. Side effects now re-check the row under a per-session lock. - A stop whose winning replica died between the CAS and the writers left the session serving forever. The receipt records finalization; a replay that finds it unfinalized finishes the deny marker, teardown and history. - Expiring a stale local copy stopped an attempt another replica was still feeding, or overwrote its stop. Expiry now defers to a row that is stopped or saw progress after the local copy went idle. - Admin terminate only stopped local memory. It now stops the attempt row and denies the tokens even when another replica holds the session. - The v2 media routes checked account ownership only; a household profile could read another profile's session by id. Every media, subtitle and font route now refuses a non-owning profile. - Subtitle and font routes did not reconstruct from the signed stream reference and answered 404 after a restart. They reconstruct like media. Web: a profile switch tears playback down instead of leaving the old profile's media mounted and reporting under the new one; an audiobook waits for the previous part's stop before starting the next so an account at its stream cap is not refused; picking another chapter of the already loaded part seeks the element instead of only updating the displayed time. Related issue: #135 Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(playback): claim stop finalization, replay progress writes, refuse replans on stopped rows Second review round on the sequenced stop path: - Two replays of an unfinalized stop could each run the history writer, which mints a new history row per call. Finalization is now claimed on the attempt row with a lease (ClaimStopFinalization); one caller runs the writers, the rest replay the stored receipt. An expired lease is taken over so a dead claimant does not wedge the attempt. - A retried identical progress sample answered "replayed" without redoing persistence, so a lost reply before the side effects ran left the resume position stale. The replay persists again; the writers are idempotent for an identical position. - A late seek or recovery on a session another replica had stopped could launch a replacement transport and overwrite the stopped row. Replan refuses a stopped attempt up front, CompleteReplan's predicate refuses it too, and the transport is rolled back when the stop lands mid-replan. - The per-session progress lock map is cleared when the attempt stops, expires, aborts, or is terminated. Related issue: #135 Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(playback): guard progress writes with the row, stop the finished audiobook, budget the stop after draining Third review round on the sequenced progress and stop path: - Progress side effects could land out of row order across replicas: A passed its row check for sequence 1, B applied and persisted sequence 2, then A's last-write-wins user-store write overwrote it. The process-local lock cannot order that, so the row is the guard: after writing, the writer re-reads the row and rewrites the newer sample if it moved. The last writer therefore writes the latest sample. - The final audiobook part's `ended` never stopped the session, so the server kept the paused session and any transcode until the reaper ran. The hook now stops it, releases the control socket, and starts a new attempt from the beginning on the next Play. - The web stop computed its 30s retry deadline before waiting up to 30s for queued progress, so a slow drain left the DELETE a 1 ms timeout and no retry. The stop budget now starts after the drain. Related issue: #135 Co-Authored-By: Claude Fable 5.1 <[email protected]> --------- Co-authored-by: Claude Fable 5.1 <[email protected]> * fix(web): support ES2022 array methods * ci(docker): publish apiv2 image * refactor(apiv2): move shared request validation (#1010) * feat(api): add bundled Swagger UI documentation viewer * chore: repair API v2 validation fixtures and formatting * fix(web): complete API v2 QA repairs * ci: use Ubuntu sources for libvips installation * fix(web): repair API v2 playback edge cases - Reset audiobook playback state after failed starts - Ignore stale live translation events - Normalize API v1 and relative stream paths to v2 * test(api): cover v2 auth denial envelopes * fix(web): keep relevance ranking for text search The smart-collection preview fix made every query-source request send the client default added_at sort, which bypassed the server's relevance ranking for text search. Send a query-source sort only when a library scopes the browse or the viewer or an editor chose it. Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(subtitles): keep regional language variants distinct Subtitle language canonicalization collapsed every tag to its base, so pt-BR and pt-PT stored and matched as the same language, and SubDL's BR_PT code parsed as Breton. Keep script and region subtags that name a distinct variant, map SubDL and SubSource provider codes both ways, and offer Brazilian Portuguese in the web search picker. Also restore the bridge-import test that refuses the current userdb schema and correct the history-import doc's account of the column names. Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(subtitles): satisfy lint and typecheck for language variants Name the repeated language tags as constants and type the test fixture as a QueryDefinition so the literal sort field is not widened. Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(apiv2): address native API audit findings * fix(apiv2): respect demo restrictions in email capability * docs(apiv2): update capability response contracts * feat(settings): consolidate server public URL * fix(settings): include public URL migration * fix(apiv2): address remaining capability review findings * feat(api): extend account and playback discovery Add exact account identity filtering, account-filtered playback pages, bounded playback summaries, and restricted library discovery scopes. Reuse existing repositories and loaders, bind filters to cursors, and keep summary responses free of diagnostic metadata. Update API documentation, fixtures, OpenAPI, and generated web types. AI disclosure: AI-assisted implementation and validation using Codex CLI 0.153.4 through T3 Code with gpt-6-astra. An independent Codex subagent reviewed authorization, SQL filtering, cursor isolation, privacy projection, compatibility, and the final shared-pagination fix; no actionable findings remained. * fix(api): refresh capability fixtures after base merge * style: format go files * fix(api): refresh route manifest and playback capability revision * fix(api): address review feedback * feat(subtitles): canonicalize language tags across API and web * fix(subtitles): preserve bridge language compatibility * fix(lang): satisfy canonicalization lint * fix(lang): preserve bridge values and strict v2 projections * fix(subtitles): preserve legacy bridge rows * fix(subtitles): isolate bridge language compatibility * fix(subtitles): retain canonical SubDL bridge values * fix(subtitles): preserve SubSource bridge language spelling * test(lang): cover variant extension and private-use validation * chore(apiv2): refresh subtitle metadata fixture * fix(scanner): canonicalize subtitle languages during ingest * fix(database): repair stored subtitle languages with the scanner's canonicalizer The SQL backfill restated lang.CompatibleTag as a nine-entry CASE plus a two-or-three-letter regex. Anything outside that set was rewritten to an empty string, so region and script tags such as en-US, zh-Hans and sr-Latn and display names such as Spanish lost their language on disk, while three-letter codes such as fre and ger passed the regex and stayed non-canonical. Its progress NOTICE also reported only the second UPDATE's row count because the second GET DIAGNOSTICS overwrote the first. Replace it with a Go migration that collects the distinct stored values, asks lang.CompatibleTag for each one, and pushes only the changed pairs back into SQL as a jsonb lookup. Rows whose values are already canonical are never touched. Each id window commits in its own transaction and both column counts are logged per batch. The pgx notice forwarder is no longer needed and is dropped. Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(database): leave unparseable subtitle languages untouched during repair A repair migration cannot restore a value it overwrites. Stored tags the canonicalizer rejects, such as grandfathered BCP 47 forms or tokens the old scanner accepted verbatim, are now logged and skipped instead of erased. New ingests still apply the strict rule at the scanner. Co-Authored-By: Claude Fable 5.1 <[email protected]> * chore(database): check rows.Close in subtitle language backfill Co-Authored-By: Claude Fable 5.1 <[email protected]> * chore(database): use context-aware slog calls in subtitle language backfill Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(lang): resolve grandfathered tags and keep facet casing canonical CanonicalTag's grammar prefilter cannot express the irregular BCP 47 forms (i-klingon, en-GB-oed, sgn-BE-FR), so ingest erased them. Fall through to the parser for hyphenated values the grammar rejects; it resolves each to its registered replacement and still rejects free text. The subtitle facet lowercases both arms so filter comparisons stay case-insensitive, which surfaced zh-hant and pt-br in the catalog filters while items carry zh-Hant and pt-BR. Restore canonical casing on the way out, deduplicating spellings that collapse to one tag. Co-Authored-By: Claude Fable 5.1 <[email protected]> * refactor(apiv2): share household profile verification * refactor(apiv2): map collection commands explicitly * refactor(apiv2): share streaming response writer * refactor(scenarios): share acceptance validators and snapshots * refactor(apiv2): remove empty raw handshake registry * refactor(apiv2): share watch together room responses * refactor(web): centralize session authority helpers * refactor(web): share autoscan pagination * refactor(web): share settings baseline hook * refactor(web): move history import conversion to api * refactor(web): retire obsolete transport and reader helpers * fix(web): remove unused notification authority import * fix(web): remove unused history import types * fix(web): preserve lint-safe settings baseline helper * style(web): format autoscan pagination changes * fix(web): remove redundant settings context reads * fix(web): retain history import source and run types * style(web): format authority helper changes * fix(apiv2): reuse direct disposition header constant * fix(web): retain settings authority snapshot * fix(database): converge subtitle language backfill * docs(apiv2): update route reconciliation contract * docs(apiv2): remove stale raw registry references * fix(database): bound subtitle backfill convergence * docs(api): name worker protocol ledger extension * test(api): repair shared Go fixtures * test(api): repair shared Go fixtures * test(api): repair shared Go fixtures * test(api): repair shared Go fixtures * test(api): repair shared Go fixtures * test(api): repair shared Go fixtures * test(api): repair shared Go fixtures * test(api): repair shared Go fixtures * test(api): repair shared Go fixtures * test(api): repair shared Go fixtures * test(api): repair shared Go fixtures * test(api): repair shared Go fixtures * feat(observability): add profiling and resource monitoring Add a loopback-only pprof listener, bounded resource attribution, runtime and workload metrics, dependency instrumentation, and admin v2 resource capabilities. Include OpenAPI and web artifacts, operational dashboards, profiling tooling, and tests for the new observability surfaces. AI disclosure: Implemented with Codex (GPT-6) through the Codex agent harness. Independent adversarial reviews were performed by subagents covering profiling security, resource accounting, dependency instrumentation, workload labels, API contracts, startup, and observability. Findings were reproduced, fixed, and re-tested. * fix(apiv2): remove legacy web transport and URL leaks * fix(apiv2): cover conditional web operations and fixtures * fix(web): remove unused legacy client helpers * fix(apiv2): track conditional web operation consumers * style(web): format client test imports * fix(apiv2): attribute migrated client consumers * fix(observability): isolate metrics listener from public port * docs(apiv2): clarify jellyfin web consumer * feat(observability): expand Grafana metric catalog * fix(playback): retry proxy refusals on API origin * fix(playback): preserve recovery attempt history * fix(db): enforce account references on apiv2 * chore(db): retire unused sync and migration tables * fix(playback): bound v2 start and stop retries * fix(auth): prevent refresh replay of public credential exchanges * fix(worker): ignore deleted accounts in session snapshots * feat(notifications): enable push relay delivery by default with setup wizard notice Mobile push delivery through the Silo relay now defaults to on for new installs. The push sender self-registers with the relay on the first send when no credential is stored. A new setup wizard step shows the privacy disclosure and lets the admin turn delivery off before finishing setup. Servers that already have an account are pinned to off by migration so nobody is opted in without seeing the notice. Co-Authored-By: Claude Fable 5.1 <[email protected]> * test(db): seed account owners for admin job fixtures * fix(notifications): align effective push default and serialize relay registration The admin effective-settings table still reported both push delivery keys as "false", so the wizard and admin page showed push off while the server delivered. Report "true" to match the runtime default. First-time relay registration now takes a Postgres advisory lock and re-reads the stored credential before registering, so replicas that start delivering at the same time share one relay deployment instead of each registering their own. Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(notifications): share relay registration lock with the admin endpoint Move the cross-replica registration lock into a reusable primitive and run the explicit admin register path through it, so an admin click and a first-use send cannot both register and overwrite each other. A caller that loses the lock gets a retryable 409 with Retry-After. Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(notifications): keep stored relay origin and block wizard step on load failure After the locked reload finds a credential another writer registered, keep that credential's relay origin rather than the one read before the lock. The wizard push step now shows an error with a reload action when the settings snapshot is missing or failed, instead of rendering the switch off and letting the admin continue without persisting a value. Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(notifications): persist first-use relay registration compare-and-set Holding a session advisory lock across the relay round trip reserved a pool connection while the settings reads and writes needed another, which deadlocks on a single-connection pool. Replace it with an atomic read-check-write through the settings repository's UpdateAtomic: the relay registration is stateless, so a losing registration is discarded and the stored winner returned. The admin register path uses the same primitive. Test pushes no longer require a stored credential; they take the same first-use registration path as ordinary deliveries. Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(notifications): keep admin-cleared relay parked and reject origin mismatch Clearing the relay credential now sets the re-registration marker, and the sender checks that marker before first-use registration, so an explicit clear stops delivery until an admin registers again as the UI promises. When the admin register request loses the compare-and-set to a first send against a different relay origin, the handler now returns a 409 instead of reporting the requested origin as registered. Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(notifications): honor concurrent clear and fail closed on unreadable delivery gate The registration compare-and-set now yields whenever the stored state carries the re-registration marker, so an admin clear that lands while a first-use registration is in flight wins. The sender and the admin endpoint treat that outcome as parked. The mobile push delivery toggles now report disabled when the settings row cannot be read and nothing is cached, instead of applying the default-on fallback over a stored opt-out. The admin notifications page shows an error with reload when the settings snapshot is missing, matching the wizard step. Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(db): repair orphan account references during migration * fix(contracts): reconcile migration ledger with the metrics listener The metrics listener split (469d1b670) moved promhttp.Handler() to the opt-in operational_metrics listener and left the root listener answering /metrics with http.NotFoundHandler(). The route inventory was regenerated but the migration ledger was not, so verify-migration-ledger failed on every apiv2 run since. Exclude operational_metrics from ledger reconciliation the same way operational_debug is excluded, pinned to its exact listener, method set, and path, and update the nine root /metrics ledger rows to the handler the inventory records. Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(contracts): skip the metrics listener in the ledger generator build_ledger.py seeded operational_metrics rows the verifier now excludes, so a regenerated ledger would be rejected. Skip that listener alongside operational_debug and note both exclusions in the ledger description. Co-Authored-By: Claude Fable 5.1 <[email protected]> * chore(db): standardize identity IDs and storage names for apiv2 * test(db): cover cached sequence reservations across conversion * test(invitations): retain the invitation identity in fixtures * chore(db): widen core parent IDs after schema standardization * test(scanner): check bigint fixture rollback * fix(activitylog): apply path rules to the v2 API surface The activity log middleware is mounted for the whole API router, but its exclusion and stream-chunk lists only named /api/v1 paths. On /api/v2 that logged one activity row per HLS segment, transcode manifest and subtitle fetch, and logged the admin log viewer's own polling back into the log it was reading. Add the v2 admin log prefix to the exclusions and the v2 stream and transcode prefixes to the stream list. Chunk detection already matches on path shape (/segment/, /master.m3u8, /subtitles/), which is identical on both majors, so it needed no change. The new table-driven tests pin the behavior for v1 and v2 together, including that neighbouring paths such as /api/v2/admin/stream-telemetry/parity stay logged. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(apiv2): restore demo-mode blocking on download mutations v1 blocks POST and DELETE under /api/v1/downloads for non-admins when demo.enabled is set, but the v2 download operations never declared DemoRestricted, so demo deployments let a member create, delete and monitor downloads through /api/v2. Declare the flag on exactly the operations v1's prefix guard covers: createDownloads, deleteDownload, createDownloadSubscription, deleteDownloadSubscription and syncDownloadSubscription. PATCH is not in v1's blocked method list, so reportDownloadStatus and updateDownloadSubscription keep passing. The download capability document now folds the demo answer into `allowed`, the same way notification email verification does, so clients discover the restriction without attempting a mutation. Regenerated contracts/api/v2/openapi.json (x-silo-demo-restricted) and the system-info fixture whose contract digest follows it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * chore(contracts): ratify the pending ledger rows and refresh sibling pins The migration ledger still carried 62 proposed rows: 14 /api/v1 removals whose owner was the pending:#135 placeholder the gate refuses to ratify, and 48 documented exclusions (root catch-alls, plugin-proxy wildcards, /api/v2 delegations, operator /metrics). Ratify all of them: the removals now name Quick104 and record the decision in notes, and the exclusions mirror the already-ratified exclusion row, which records no owner because the schema requires one only for removed, redesigned, and replaced rows. No disposition or v2 mapping changed. Repin the sibling source trees to the current silo-apple and silo-android commits and rebuild the ledger through scripts/apiv2-ledger (extract, match, build), so mechanical call sites match the trees the line numbers refer to. Both clients have moved much of their traffic to /api/v2, so 102 sibling credits fall away and 22 rows lose their last first-party consumer; curated fields, manual sites, and follower sites are preserved verbatim. Six manual sites moved at the new pins (the Apple rebrand renamed two files, downloads and subtitle URL building moved to the v2 manifest path, the Android ebook read path moved) and are re-resolved by hand in both the ledger and the seed table in build_ledger.py. Three Android push sites whose path is a companion-object constant gain path_literal_line 73. The pinned-tree test asserted that a credited site mentions the v1 route's last static path segment. match_consumers.py deliberately credits a client's v2 call back to the v1 row it aliases, so a row whose v2 operation renamed the last segment (status -> capabilities, capability -> capabilities) reported a correct site as mis-credited. The assertion now accepts the row's own segment or its mapped v2 operation's, and the synthetic unit test covers both outcomes. The matching prose in docs/architecture/api-contract.md still describes the old single-segment rule and needs a follow-up edit. Also make the extract_consumers.py docstring raw so its escaped backtick no longer raises a SyntaxWarning. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * refactor(api): mint client-facing URLs in the v2 namespace Branding assets, offline manifest asset refs, webhook-sync receivers, autoscan delivery URLs and plugin auth-provider icons were all minted as /api/v1 paths and then rewritten by the v2 projection. Two of those URLs escape the API entirely — the SPA favicon link and PWA manifest bake the branding path in, and the autoscan delivery URL is pasted into an external Sonarr/Radarr instance — so nothing would rewrite them once the /api/v1 tombstone lands. Each service now mints the v2 form, and the v2 handlers validate instead of translating: the download manifest projection still refuses any reference outside its own download prefix, and the auth-provider icon projection still requires a local, non-traversing asset path that the proxy reports public. The bridge release serves both namespaces, so the v1 responses carrying these values keep resolving. The playback planner is untouched: it mints session-relative paths (/stream/..., /playback/transcode/...), not /api/v1 ones, so playbackV2MediaURL keeps its defensive /api/v1 branch. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * docs(api): make /api/v2 the primary surface in client docs and scripts The native API contract makes /api/v2 the stable 1.0 surface and /api/v1 a frozen alpha bridge, but the client-facing docs still led with v1 paths and several scripts still called v1 routes. A reader following docs/scan-api.md or docs/downloads-api.md would build an integration against a surface that answers 410 Gone at 1.0. Rewrite the affected docs so v2 leads and the v1 shape survives only in a marked bridge section, taking every path, operation ID, status, and field from contracts/api/v2/openapi.json and the migration ledger: - scan-api.md is now a v2 integration guide that cross-links the scan control contract instead of restating it, and documents the autoscan webhook receiver. - downloads-api.md, admin-api.md, api-keys-api.md, settings-api.md, and catalog-api.md put the v2 operations first and keep a short bridge note; settings moves its v1 reference to the end of the file. - images, auth, playback, and notifications-push get proportional fixes. - update-to-1.0.md replaces the placeholder integration table with the real v2 receiver paths, records that plex-sync has no v2 receiver of its own and that webhook-sync is its successor, and keeps the release commands marked unknown. - The capability proposal template asks for /api/v2 operations. - scripts/silo-dev and the k6 load test call v2; the Continuum migration docs and script keep the retained /api/v1/health and /api/v1/ready probes with a note explaining why. Related issue: #135 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(api): align v1 webhook-sync reads with v2 receiver URL The v1 list and get handlers still minted the retired /api/v1 webhook-sync receiver path while create and rotate returned the v2 one. Also records the widened pinned-tree segment rule in the contract doc. Co-Authored-By: Claude Fable 5.1 <[email protected]> * test(activitylog): fix misspelling flagged by lint Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(apiv2): keep projecting legacy plugin icon URLs A capability manifest may still name its icon under /api/v1/plugins/; runtime config mints the versioned form. Project the legacy shape onto the plugin-content mount after the same public-route check so the icon survives the v1 tombstone, and correct the auth-api doc paragraph. Co-Authored-By: Claude Fable 5.1 <[email protected]> * docs(downloads): gate on effective allowed and describe bridge manifest URLs Co-Authored-By: Claude Fable 5.1 <[email protected]> * docs(scan): mark the profile headers optional for acting admins Co-Authored-By: Claude Fable 5.1 <[email protected]> * perf(sections): serve fresh badges without scan refresh stalls (#1065) * perf(sections): read fresh badge summaries with bounded result rows * perf(sections): refresh scan membership without blocking warm readers * fix(sections): start scan refresh grace when readers return * fix(apiv2): accept every advertised API key scope on create POST /api/v2/api-keys and POST /api/v2/admin/api-keys rejected libraries:read and admin:sessions:summary:read even though the v2 scope catalog advertises them: the shared creation method validated against the frozen v1 catalog. Switch the canonical creation method to the full catalog and leave both v1 create transports on the v1 validator, so the frozen v1 catalog is unchanged. Unknown scopes now return a 422 whose errors[] entry names the offending scope at body.scopes, matching other v2 validation refusals. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * perf(catalog): join the history projection on the keyset path GET /api/v2/catalog?source=history timed out after 10s with 503 on a dev-sized profile (~380k user_watch_history rows, 100k+ media items), while the v1 offset path answered the same request in ~0.5s. v2 always sets CursorPaging, which routes the history source through the keyset resolver. There the source order term was a correlated subquery — (SELECT watched_at FROM (<whole history aggregate>) personal_history WHERE personal_history.display_id = mi.content_id) — and the membership predicate wrapped the same aggregate in EXISTS. Because that expression appears in ORDER BY, in the cursor key projection, and in the keyset seek predicate, PostgreSQL cannot hoist it: the plan becomes a media_items scan with a SubPlan that re-runs the DISTINCT ON over user_watch_history (plus the episodes lookup and the hidden-items anti-join) once per candidate row. Cost is rows-considered x history-size, which is why it degraded to a timeout rather than a slow response. The offset path already had the right shape: project history once as the history_display CTE and JOIN it as history_source. This gives the cursor path the same projection. QueryExecutor gains SourceCTE and SourceJoin (rebound from SourceArgs like SourceWhere already was); the history source sets them and orders by history_source.watched_at, so the aggregate is evaluated exactly once per statement and the join is a plain hash/merge join against the deduplicated display_id set. DISTINCT ON (display_id) makes display_id unique, so the inner join filters identically to the EXISTS it replaces — count and page stay consistent. Cursor semantics are unchanged: the order stays (watched_at desc, then content_id asc; asc when sort=date_viewed asc), the same two typed keys are emitted and seeked, so cursors still round-trip. Tests assert the generated SQL orders from the join, contains no subquery in ORDER BY, reads user_watch_history exactly once, keeps the join for non-history sorts and for the count query, and seeks on the joined key. DB-backed tests were skipped: SILO_TEST_DATABASE_URL is not set in this environment. No v2 operation, input, response type, or status set changed, so the committed OpenAPI artifact is untouched. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(apiv2): stop collapsing admin history-import failures to 503 Two administrative history-import operations threw their error away and answered every failure with 503 dependency_unavailable, so a source that does not exist, a source with no stored admin token, and a Plex password the account holder mistyped were all reported as an outage. listAdminHistoryImportExternalUsers now routes the DiscoverExternalUsers failure through adminHistoryProblem, which keeps 404 for a missing source and 409 for a source whose state does not permit the call; only a failure no sentinel explains stays the fail-closed dependency problem, and the operation declares the 409 it can now produce. loginAdminHistoryImportPlex reuses historyImportProblem and the ratified upstream split: a source server that answered below 500 is a validation failure carrying its message, anything else is 503. The administrative service returns the client's raw error where the personal seam converts first, so adminHistoryUpstreamError performs that one conversion rather than growing a second mapper. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(admin): accept the full session page size and keep device timestamps Two administrator defects on /api/v2. GET /api/v2/admin/sessions returned 500 for any limit between 101 and 200. The shared LimitParam declares a maximum of 200, but the bounded loaders in internal/api/handlers/playback_sessions.go rejected anything above 100, and the v2 handler maps that application error to an internal-error problem. Raised the application bound to 200 (MaxSessionPageLimit) rather than lowering the declared v2 maximum to 100. The 100 was a plain guard against an unbounded page request, not a measured performance ceiling: the frozen v1 bridge's Load path already materializes and enriches the newest 200 observations on every request, so the largest page a v2 caller may now ask for costs no more work than v1 does today. Lowering the input instead would have made /admin/sessions the one paged operation with a smaller maximum than the API-wide convention, for no reason a client could discover. Requests above 200 stay a 422 from the declared schema. The summary operation declares its own, smaller maximum of 100 and is unchanged; it hit the same guard from LoadSummary, which now shares the bound. GET /api/v2/admin/devices and /admin/devices/{user_id}/{device_id} reported last_updated as null for every device whose timestamp came from the registry rather than from a device setting. The Postgres store read last_seen_at as Postgres text, so DeviceEntry.LastSeenAt carried a second, non-RFC3339 format that the v2 projection could not parse. Fixed at the source: ListDevices now scans the column as a timestamp and formats it RFC3339Nano, matching what ListDeviceSettingsPage already does, so the registry timestamps and the device-setting UpdatedAt values buildAdminDeviceSummaries merges finally share one format. That also repairs the lexicographic newest-wins comparison in that merge, which previously ordered the two formats against each other. v1 keeps a timestamp string with the same meaning. deviceMetadataInstant also accepts the Postgres renderings as a backstop, so an older raw value projects a time instead of a null. No v2 operation, input, response, or status set changed, so the committed OpenAPI artifact is unchanged. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(apiv2): accept ULID notification delivery ids The v2 notification path parameters declared format:"uuid", but notification_deliveries.id is a text ULID minted by ulid.Make in internal/notifications. Every real id therefore failed input validation with 422 before reaching the service, breaking getNotification, markNotificationRead, and getNotificationApplePushDisplay. Drop the uuid format from NotificationItemInput.ID and NotificationPushDisplayInput.DeliveryID, keeping minLength:"1". No maxLength or ULID pattern is added: the column is free-form text and tightening it would be a breaking contract narrowing for no gain. Tests now use ULID fixtures and assert that a ULID id reaches the handler (200 for a known row, 404 for an unknown one). The docs no longer claim delivery IDs must be UUIDs. OpenAPI and fixtures regenerated. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(admin): return 404 for malformed autoscan and diagnostics ids An admin id that is not a UUID reached Postgres and raised SQLSTATE 22P02, so /api/v1 and /api/v2 answered 500 on a request that simply cannot match a row. Every affected id column (client_diagnostic_reports.id, autoscan_sources.id, autoscan_connections.id, autoscan_webhook_endpoints.source_id) is a `uuid`, so a malformed id can only ever miss. Validate the id at the shared service layer, before the query, and return the existing not-found error: diagnostics.Service.GetReport/DeleteReport return diagnostics.ErrNotFound, and the autoscan repository returns autoscan.ErrNotFound from the source, connection and webhook-endpoint lookups. Both API surfaces already map those to 404 (and 204 for the v2 diagnostics delete), so no handler or contract change is needed. A source write that binds a malformed connection id maps to ErrNotFound too, matching how the existing foreign-key violation for a missing connection is already reported. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(apiv2): repair three admin catalog regressions Section preview returned nothing when library_ids was omitted: the wire conversion built a non-nil empty slice, which the section fetcher reads as "scoped to zero libraries" rather than unscoped. It now returns nil for an absent or empty list, matching what v1 sends. Syncing a manual collection answered 500. The catalog service now exports ErrLibraryCollectionSyncModeUnsupported for a collection with no importable source mode, and the v2 admin collection error mapper turns it into 422. Applying a template bundle dropped the per-entry reason, the only explanation a caller gets for a skipped or failed template. The three v2 template entry types carry it again, projected from the shared v1 result. The OpenAPI artifact and fixtures are regenerated; all three schema additions are optional properties. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(api): classify four service failures that answered 500 Four v2 operations answered 500 for valid requests because the service returned an untyped error the problem mappers could not classify. Each is fixed where the condition is known, so the v1 bridge improves with it. - Downloads: a media-file lookup that misses now maps scanner.ErrFileNotFound onto catalog.ErrItemNotFound, so an unknown file_id is 404 on direct download, its HEAD and proxy variants, and download creation. - Subtitles: the manager reports an unregistered provider as subtitles.ErrUnknownProvider, which both subtitle download paths render as 404 provider_not_found while real upstream failures stay 500. - Watch providers: watchsync.ErrInvalidCredential gives built-in providers a transport-agnostic way to signal a rejected credential; mdblist wraps it for 401/403, and the plugin-fault check recognizes it, so an API-key connect with a bad key is a 4xx. - Requests: a router transport failure while listing integration options is reported as requests.ErrIntegrationUnreachable and rendered as 503 dependency_unavailable; plugin validation results still pass through. No v2 operation definition or status set changed, so the committed OpenAPI artifact is unchanged. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(apiv2): route admin history-import upstream failures by their cause The follow-up to the 503 collapse left three gaps. The web contract types were not regenerated after listAdminHistoryImportExternalUsers gained 409, so the generated schema disagreed with the committed OpenAPI artifact and verify-apiv2-web-types would fail. Discovery still answered 503 when the source server itself answered and rejected the stored admin token. A source server that replies below 500 is a configuration problem the administrator fixes on the source, so that is now 409; discovery is a GET, so it is a state conflict rather than a body validation failure. Only a source server that could not answer stays the dependency problem. Plex sign-in failures that are neither an upstream status nor a reachability error - plex.tv answering 200 with no token, the client rate limiter refusing the call - reached serviceProblem and were reported as 500 internal_error, blaming Silo for a plex.tv anomaly. They report the dependency again, while the ratified upstream split still decides the cases it recognizes. historyimport.UpstreamHTTPError lets a mapping test outside the package build the error a source server produces; the client types that carry the status are unexported. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * chore(contracts): regenerate v2 artifacts after merging dev-verification fixes Co-Authored-By: Claude Fable 5.1 <[email protected]> * chore(web): regenerate v2 contract types Co-Authored-By: Claude Fable 5.1 <[email protected]> * chore(scripts): send the profile header on v2 helper and load-test requests Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(apiv2): sanitize template reasons, validate exact UUID ids, PIN-aware dev helper Template-bundle apply projected raw service error text into the reason field; v2 now passes only the documented reason codes through and reports operation_failed for anything else. The autoscan and diagnostics id guards validated a trimmed copy but bound the original, so a padded UUID still reached Postgres. The silo-dev api helper mints a profile token from SILO_ADMIN_PROFILE_PIN when the primary profile is locked. Co-Authored-By: Claude Fable 5.1 <[email protected]> * refactor(apiv2): build the template reason allowlist from one list Co-Authored-By: Claude Fable 5.1 <[email protected]> * refactor(apiv2): finish server migration cleanup * fix(web): lighten hero backdrop and simplify scrim layers - Raise default hero brightness/saturation and reduce the detail scrim wash - Anchor the bottom fade to the copy block, drop stacked duplicate fades - Replace the left/bottom vignette with a soft radial edge darkening - Grow hero banner sizing for a taller cinematic frame * feat(settings): expose common regional language tags (#1071) * feat(web): redesign the setup wizard (#1068) * feat(web): redesign the setup wizard The first-run wizard was nine generic cards in a fixed order with a dead profile step, a "Server & storage" page that mixed Redis, playback, the Jellyfin web installer, and two S3 buckets, no way to name the server or set its public URL, a bare hardware-acceleration dropdown, and a library form with twenty decisions. Progress lived only in browser storage and /setup stayed reachable forever. Rebuild it as eight steps on a labelled step rail: Account, Server, Playback, Storage, Libraries, Subtitles, Connect apps, Features, Done. Finished rungs record what was chosen and can be reopened. Steps use the admin settings row primitives so setup and administration read as one product. Server name, public URL, and trusted proxies get their own step; Playback shows the detected GPU and both HDR tone-mapping toggles; Storage reports Redis and S3 as status rows and detects an environment-managed Redis; Libraries only asks for name, type, and folders, with edit and delete; subtitle providers save in one Continue; the Jellyfin web installer and worker nodes leave the wizard. Account creation selects the default profile in the same render so the next step lands drawn rather than as a skeleton. A new setup.completed server setting is written from the final screen and reported on the public setup-status endpoint as an additive wizard_completed field; the web client redirects /setup to the admin area once it is true. A migration sets the marker for every install that already has an account. Every path that stores an account or notification address now shares one email rule (auth.ValidateEmail): a single bare mailbox with a dotted domain, so "admin@siloserver" is refused on setup, signup, admin account writes, invitations, and the profile notification address. The web forms apply the same check before sending. The wizard's storage step also gains the Cloudflare token fields the admin page already had (#325). Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(web): address setup wizard review findings Persist setup.completed before clearing local progress and navigating, so a failed write keeps the admin on the Done step with a retry instead of reopening an empty wizard. Read setup status and the provider list independently at boot so a failed provider fetch cannot blank the completed flag. Hold the account step until a profile is selected, retry the profile lookup from the wizard when the one made during account creation fails, and offer profile creation for an account that has none. Reload a subtitle provider's validator after every save attempt so a retry never sends a stale If-Match. Tie connection-check results to the values that were tested so editing a field clears a stale green result. Keep the stricter email rule on v2 transports only; the frozen v1 setup, signup, and admin account routes keep their previous acceptance. Match the client literal-domain check to what net/mail accepts. Fix the import grouping in the auth service and make the migration's down step a no-op, since a backfilled marker cannot be told apart from one the wizard wrote. Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(web): finish setup wizard review follow-ups Apply the strict email rule to v2 invitations in the transport, and restore the previous net/mail acceptance in the shared invitation service and the v1-only notification address, so no frozen v1 route changes behaviour. Gate the wizard's library read on a selected profile like its other acting-admin reads. Keep a subtitle provider's test result only while the draft still matches the credentials it tested. Co-Authored-By: Claude Fable 5.1 <[email protected]> * chore(web): format the generated settings bindings PR #1071 on apiv2 regenerated web/src/lib/settingsContract.ts without the prettier pass the settings-bindings target runs, so the Web format check failed for every branch rebased onto it. Regenerate through the target; the content is unchanged. Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(web): close remaining setup wizard review gaps Compare the whole connection-check request, dirty keys included, so a staged secret clear does not keep an older success. Drop a cancelled subtitle editor read from the loaded set so the next list refresh can issue it again. Ask before a rail click discards unsaved edits, since the setup route mounts no router guard. Disable Continue on the library step while an editor is open. Send an admin whose profiles are all PIN-locked to the profile picker with a redirect back to setup. Co-Authored-By: Claude Fable 5.1 <[email protected]> --------- Co-authored-by: Claude Fable 5.1 <[email protected]> * fix(scanner): preserve audio language subtags (#1072) * feat(settings): expose common regional language tags * fix(scanner): preserve audio language subtags * fix(playback): prefer exact language tags (#1074) * fix(playback): prefer exact language tags * fix(playback): honor exact series language tags * fix(playback): restore language signature matching * fix(playback): keep saved series index across regional tags Address review findings on #1074: - SelectAudioTrack step 2 required an exact tag match, so a preference saved as {index: 1, lang: "en"} against a track now tagged "en-US" fell through to the language search and could pick a different track. Any compatible language match now keeps the saved index. - Drop the redundant sameLanguage guard in findPreferredSubtitleIndexWithSignature; languageMatchRank already rejects mismatched languages. - Re-export canonicalLanguageTag from the player languageNames shim so subtitleSort.ts resolves its import (the subtitle test file was failing with "canonicalLanguageTag is not a function"). Co-Authored-By: Claude Fable 5.1 <[email protected]> * fix(playback): clarify language selection priority * fix(playback): rank signature matches by language tag findExactAudioTrack returned the first track whose signature matched, and signature matching accepts any compatible language variant. When two tracks differ only by regional tag, an earlier en-GB track won over the exact en-US track a saved signature named. Rank the matches by language tag instead: exact tag, then bare language, then another variant. A legacy bare-language signature still matches a regional track. Co-Authored-By: Claude Fable 5.1 <[email protected]> --------- Co-authored-by: Claude Fable 5.1 <[email protected]> --------- Co-authored-by: Claude Fable 5.1 <[email protected]> Co-authored-by: Codex <codex@localhost>
Problem
The API accepted regional BCP-47 language tags, but several web selectors offered only base languages. Users could not easily choose distinctions such as Brazilian versus European Portuguese.
Solution
pt-PTto the shared player and translation language list.Related issue: N/A — narrow fix
Validation
go test ./internal/settingscontract ./internal/settingskeysAI disclosure
This pull request was prepared with OpenAI GPT-6 via the Codex agent harness. AI assistance was used for repository inspection, implementation, and validation; the final patch and description were reviewed by the author.