Commit Graph
237 Commits
Author SHA1 Message Date
RXWatcherandClaude Opus 4.7 cae5fb03b3 feat(audiobooks): migrations 154 + 155 for Phase 1 close-out
154 adds hide_from_continue to user_watch_progress (backs the
ABS remove/readd-to-continue-listening endpoints). 155 creates
abs_rss_feeds for the upcoming RSS surface.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 21:46:21 +02:00
RXWatcherandClaude Opus 4.7 b83155d7de docs(audiobooks): Phase 1 close-out implementation plan
7 TDD-ordered tasks covering migrations 154/155, listening stats,
author/series detail, continue-listening toggles, and the minimal
viable RSS surface (item feeds only). Public RSS routes (slug as
capability token) mount alongside the existing public-session block.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 21:44:39 +02:00
RXWatcherandClaude Opus 4.7 e202d08982 docs(audiobooks): Phase 1 close-out spec (stats + author/series + continue + RSS)
Combined spec for the four remaining Phase 1 surfaces. Migrations 154
(hide_from_continue column on user_watch_progress) and 155
(abs_rss_feeds). RSS scoped to item-feed minimum; series/collection
feed variants and RSS cover/track endpoints deferred to Phase 2.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 21:39:01 +02:00
RXWatcherandClaude Opus 4.7 0ab06e5242 feat(audiobooks): wire ABSSmartCollectionStore + mount routes
Pgx-backed store + service wiring + six routes registered under both
/abs/api and /api prefixes inside the existing bearerAuth group.
JSONB column written via $9::jsonb cast for query_def.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 20:39:49 +02:00
RXWatcherandClaude Opus 4.7 7061110ee5 feat(audiobooks): GET /me/smart-collections/{id}/items — eval + page
Items handler evaluates the stored query_def against the audiobook
catalog. Per-user state hydrated in 2 batched calls (progress list +
bookmark counts) when caller is the owner; non-owner viewing public
sees personalized rules silently dropped. Results paginated post-eval.
siloItemToSmartcollItem adapter maps silo's MediaItem onto the
audiobook-domain Item shape; author/narrator/series/publisher/
duration_seconds left as zero-values for v1.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 20:37:57 +02:00
RXWatcherandClaude Opus 4.7 e2670b3055 feat(audiobooks): list/get/patch/delete smart collections
Four CRUD handlers + tests. Anti-enumeration 404 on non-owner
private. List envelope is {"items": [...]}. PATCH re-validates
query_def when present.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 20:34:21 +02:00
RXWatcherandClaude Opus 4.7 e8b9b1bebf feat(audiobooks): POST /me/smart-collections — create + DSL validation
First handler of the smart collections surface. query_def is
normalized + validated (with allowPersonalized=true) before
marshalling to JSONB bytes for storage. Adds memSmartCollectionStore
harness.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 20:31:58 +02:00
RXWatcherandClaude Opus 4.7 d11326875f feat(audiobooks): SmartCollectionStore interface + envelope helper
Defines the storage contract and wire-shape serialiser. queryDef is
emitted as a nested JSON object on the wire (decoded from the JSONB
bytes once at serialisation time).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 20:29:11 +02:00
RXWatcherandClaude Opus 4.7 a65852ab9b feat(audiobooks): smartcoll DSL evaluator + tests
In-memory rule evaluator over Candidate{Item, IsFinished, ProgressPct,
CurrentSeconds, LastPlayedAt, BookmarkCount, PlayCount}. Covers all
15 fields + 7 operators + 9 sort keys including deterministic
seeded random. Personalized rules drop to false (silent) when
opts.AllowPersonalized is false. Decoupled from silo's catalog
model via the local Item struct — handler adapts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 20:27:49 +02:00
RXWatcherandClaude Opus 4.7 dba55e770d feat(audiobooks): smartcoll DSL — types + Normalize + Validate
Ports continuum's QueryDefinition / QueryGroup / QueryRule / QuerySort
types and the audiobook-domain field/sort catalogs to a new
internal/audiobooks/smartcoll/ package. Covers Normalize (alias +
default + dedupe) and Validate (unknown fields, invalid ops, sort,
personalization scope).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 20:24:34 +02:00
RXWatcherandClaude Opus 4.7 502f0d10d6 feat(audiobooks): migration 153 + BookmarkStore.CountByUser extension
Migration 153 backs the upcoming smart-collections surface.
BookmarkStore.CountByUser returns per-item counts in one SQL pass —
used by the smart-collection items evaluator to hydrate the
bookmark_count personalized rule without N+1 queries.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 20:22:04 +02:00
RXWatcherandClaude Opus 4.7 ba6eaf0c05 docs(audiobooks): smart collections implementation plan
9 TDD-ordered tasks. DSL package ported from continuum with audiobook
catalog. CRUD handlers + items eval with batched per-user state
hydration. Author/narrator/series/duration hydration deferred to a
follow-up — rules referencing those fields evaluate false in v1.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 20:19:48 +02:00
RXWatcherandClaude Opus 4.7 b76be2c153 docs(audiobooks): Phase 1 sub-project 3 — ABS smart collections spec
Rule-based dynamic audiobook collections. New smartcoll DSL package
ported from continuum (15-field catalog, 5 personalized; 7 operators
including in_last relative time; 9-field sort catalog with seeded
random). 6 REST endpoints. In-memory eval for our library scale;
SQL pushdown deferred to Phase 4. Migration 153.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 20:10:01 +02:00
RXWatcherandClaude Opus 4.7 7a8749739a test(audiobooks): tighten delete tests with cascade + unreachability checks
Final review flagged two small gaps in the delete tests:
- TestCollection_Delete_Owner_204 now seeds a book and asserts the
  items table is empty after delete (proves FK CASCADE works).
- TestPlaylist_Delete_Owner_FiresRemovedEvent now also asserts the
  post-delete GET returns 404 (symmetry with the collection test).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 19:59:38 +02:00
RXWatcherandClaude Opus 4.7 0339eba225 feat(audiobooks): wire ABSPlaylistStore + mount playlists routes
Adds the pgx-backed PlaylistStore impl, wires it into BuildABSHandler
when a Pool is present, and registers all ten playlists routes under
both /abs/api and /api prefixes inside the existing bearerAuth group.
AddPlaylistItem computes position = MAX+1 inside the INSERT (one
round-trip, no read-before-write race); both add and remove run in
transactions so the parent's updated_at bump is atomic.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 19:23:22 +02:00
RXWatcherandClaude Opus 4.7 1632e9a481 feat(audiobooks): batch add/remove playlist items
POST /playlists/{id}/batch/add and /batch/remove accept arrays of
{libraryItemId, episodeId?} tuples. Per-item failures are tolerated
silently (matching continuum); only a whole-body decode error
surfaces as 400. One playlist_updated event fires for the whole
batch regardless of per-item outcomes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 19:20:25 +02:00
RXWatcherandClaude Opus 4.7 ba8e5fdf96 feat(audiobooks): DELETE /playlists/{id}/item/{libraryItemId}[/{episodeId}]
Two route variants share the same body via removePlaylistItemImpl:
the bare libraryItemId form removes the item with empty episode_id;
the libraryItemId+episodeId form removes only that episode-keyed
entry, leaving other entries with the same libraryItemId intact.
Idempotent; fires playlist_updated.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 19:17:35 +02:00
RXWatcherandClaude Opus 4.7 f661659194 feat(audiobooks): POST /playlists/{id}/item — add single item
Append a new (libraryItemId, episodeId) tuple to the end of the
playlist (positions start at 1 and increment). Audiobook items
validated against MediaStore (404 on unknown); episode items
accept-and-echo per spec §7.1 (podcast hydration is a future
sub-project). Idempotent on the tuple. Fires playlist_updated.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 19:15:10 +02:00
RXWatcherandClaude Opus 4.7 7da951021e feat(audiobooks): PATCH + DELETE /playlists/{id}
Owner-gated mutation with partial-body PATCH semantics. Non-owner gets
404 (anti-enumeration). Both handlers fire realtime events
(playlist_updated, playlist_removed) — clients re-render from the
response (the event payloads carry only the id).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 19:12:40 +02:00
RXWatcherandClaude Opus 4.7 7cdbfbb637 feat(audiobooks): GET /playlists + GET /playlists/{id}
List wraps the result in {"playlists": [...]} and emits list-shape
(no items[]). Detail handler returns full-shape for owner or for any
caller when isPublic=true; otherwise 404 matching the bookmarks
anti-enumeration pattern.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 19:10:28 +02:00
RXWatcherandClaude Opus 4.7 f5dd7f79ed feat(audiobooks): POST /playlists — ABS playlist create + event
First handler of the playlists surface. Body {name, description?,
cover_item?, isPublic?} returns the created playlist in full-shape
(empty items[]). Fires playlist_added realtime event. Adds the
in-memory test harness (memPlaylistStore) parallel to
memCollectionStore.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 19:06:37 +02:00
RXWatcherandClaude Opus 4.7 2be46146f2 feat(audiobooks): add PlaylistStore interface + ABS envelope helper
Defines the storage contract and wire-shape serialiser the playlists
handlers will consume. Envelope test asserts the eight (or nine with
coverPath) top-level keys including description always round-tripped
correctly and coverPath omitted when empty.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 19:03:14 +02:00
RXWatcherandClaude Opus 4.7 5899817623 feat(audiobooks): add abs_playlists + abs_playlist_items migrations
Migrations 151 + 152 back the upcoming ABS playlist endpoints.
Schema rationale documented in
docs/superpowers/specs/2026-05-26-abs-collections-playlists-design.md
§5.3, §5.4, §5.5.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 19:01:11 +02:00
RXWatcherandClaude Opus 4.7 509dff8839 chore(audiobooks): align ABSCollectionStore with sibling-store patterns
Replace string-compare on "no rows in result set" with the canonical
errors.Is(err, pgx.ErrNoRows) — matches every other store in
internal/audiobooks/ (abs_session_store, abs_playback_session_store,
abs_progress_store) and is robust against pgx error-message changes.
Also wrap rows.Err() returns with the contextual fmt.Errorf prefix
that the bookmark store uses.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 18:52:42 +02:00
RXWatcherandClaude Opus 4.7 78732ca6fd feat(audiobooks): wire ABSCollectionStore + mount collections routes
Adds the pgx-backed CollectionStore impl (parallel to
abs_bookmark_store.go), wires it into BuildABSHandler when a Pool is
present, and registers the seven collections routes under both
/abs/api and /api prefixes inside the existing bearerAuth group.
AddCollectionItem/RemoveCollectionItem run in a transaction so the
parent's updated_at bump is atomic with the item mutation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 18:50:16 +02:00
RXWatcherandClaude Opus 4.7 e1e5b151ca feat(audiobooks): add/remove collection items
POST /collections/{id}/book/{bookId} validates the item against
MediaStore (404 on unknown) and is idempotent on the store side. The
DELETE variant is unconditional idempotent (returns the current
membership state regardless of whether the row existed). Both 404
when non-owner.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 18:47:22 +02:00
RXWatcherandClaude Opus 4.7 da21cab37d feat(audiobooks): PATCH + DELETE /collections/{id}
Owner-gated mutation with partial-body PATCH semantics (only fields
present in the body are updated). Non-owner attempts return 404
matching the bookmarks anti-enumeration pattern. DELETE cascades to
abs_collection_items via FK.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 18:44:25 +02:00
RXWatcherandClaude Opus 4.7 aedf545481 feat(audiobooks): GET /collections/{id} — owner and public access
Owner sees their own collection in full-shape (with books[]).
Non-owner sees it only when isPublic=true; otherwise 404 with the same
body as a genuine not-found (anti-enumeration pattern from the
bookmarks sub-project).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 18:41:58 +02:00
RXWatcherandClaude Opus 4.7 d9ea7be3fc feat(audiobooks): GET /collections — list caller's collections
Wraps the result in {"collections": [...]} matching continuum/real-ABS
clients. Owner-scope only (other users' collections never leaked).
Profile-scoped (collections under a different profile excluded).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 18:25:30 +02:00
RXWatcherandClaude Opus 4.7 7bdff1141c feat(audiobooks): POST /collections — ABS collection create
First handler of the collections surface. Body {name, description?,
isPublic?} returns the created collection in full-shape (empty
books[]). Backed by the new CollectionStore dependency (nil-safe:
handler returns 503 when unwired). Adds the in-memory test harness
(memCollectionStore + dispatchABSWithParams) that the rest of the
collections suite will reuse.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 18:22:41 +02:00
RXWatcherandClaude Opus 4.7 d89f6197f5 feat(audiobooks): add CollectionStore interface + ABS envelope helper
Defines the storage contract and wire-shape serialiser the collections
handlers will consume. Envelope test asserts the seven required keys
including description (which the continuum reference always emits as
empty regardless of stored value — this round-trips it correctly).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 18:18:57 +02:00
RXWatcherandClaude Opus 4.7 54c6a3b979 feat(audiobooks): add abs_user_collections + abs_collection_items migrations
Migrations 149 + 150 back the upcoming ABS collection endpoints.
Schema rationale documented in
docs/superpowers/specs/2026-05-26-abs-collections-playlists-design.md
§5.1, §5.2, §5.5.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 18:15:53 +02:00
RXWatcherandClaude Opus 4.7 e6fd12490a docs(audiobooks): Phase 1 sub-project 2 implementation plan
18 TDD-ordered tasks covering the four migrations (149-152), two
store interfaces with in-memory fakes, seven collection handlers +
ten playlist handlers, pgx-backed concrete stores, service wiring,
route registration, and the full-verification gauntlet. Total ~3000
lines; each task is bite-sized (2-5 minute steps) and produces a
green commit. Each spec §8 test maps to a task.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 16:59:59 +02:00
RXWatcherandClaude Opus 4.7 f4af284400 docs(audiobooks): Phase 1 sub-project 2 — ABS collections + playlists spec
Approved design for the second sub-project of Phase 1: manual user
collections (named groupings of audiobooks) and ordered playlists
(queue with cover image). Both profile-scoped, with cross-user
public visibility. Includes migrations 149-152, two REST surfaces
sharing a uniform CRUD shape, in-memory test fakes parallel to the
bookmark sub-project's harness, and the same anti-enumeration 404
security pattern.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 16:36:21 +02:00
RXWatcherandClaude Opus 4.7 139ec96f21 docs(audiobooks): archive ABS bookmarks implementation plan
The plan that drove the now-completed bookmarks sub-project. Belongs
on the branch alongside its sibling spec (committed in 73b9aca) per
the project convention of checking in both spec and plan.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 16:36:21 +02:00
RXWatcherandClaude Opus 4.7 0fb8323503 chore(audiobooks): tighten bookmark store + URL-time parsing
- Drop dead pgx.ErrNoRows guard in ABSBookmarkStore.Delete (Pool.Exec
  never returns it; the prior guard was misleading dead code).
- Reject ±Infinity in parseBookmarkTime so a DELETE /…/bookmark/Inf
  URL path is consistent with the POST/PATCH body path (which JSON
  itself excludes — JSON has no Infinity literal).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 15:21:06 +02:00
RXWatcherandClaude Opus 4.7 21257035d3 feat(audiobooks): wire ABSBookmarkStore into BuildABSHandler
When deps.Pool is non-nil, construct the pgx-backed store and pass
it through to the ABS handler. Mirrors the other store wirings in
BuildABSHandler; when no pool is available (tests, minimal fixtures),
BookmarkStore stays nil and the handlers respond 503.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 14:16:03 +02:00
RXWatcherandClaude Opus 4.7 ddab7be474 feat(audiobooks): ABSBookmarkStore — pgx-backed concrete store
Implements abs.BookmarkStore against abs_bookmarks (migration 148).
COALESCE-to-sentinel-UUID matches the table's unique index for
profile NULL collapsing. Upsert is one round-trip via INSERT ... ON
CONFLICT ... DO UPDATE RETURNING.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 14:11:48 +02:00
RXWatcherandClaude Opus 4.7 a0dcc860b4 feat(audiobooks): mount ABS bookmark routes at /abs/api and /api
Registers POST/PATCH/DELETE /me/item/{itemId}/bookmark inside the
existing bearerAuth group so real ABS clients hitting either prefix
resolve to the same handlers.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 14:09:36 +02:00
RXWatcherandClaude Opus 4.7 2736688538 test(audiobooks): assert realtime user_updated events on bookmark ops
Covers the three reason discriminators (bookmark_created /
bookmark_updated / bookmark_deleted) documented in
docs/superpowers/specs/2026-05-26-abs-bookmarks-design.md §4. Asserts
event count, scope (event userID), event name, and payload shape.
DELETE event uses the pre-delete snapshot so clients keep the title.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 14:07:44 +02:00
RXWatcherandClaude Opus 4.7 316ca5005a test(audiobooks): cover ABS bookmark edge cases
Adds ordering, per-profile isolation, cross-user no-op (existence
leak guard), missing-item 404, malformed-body 400, and missing-time
400 to the bookmark handler suite.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 14:06:02 +02:00
RXWatcherandClaude Opus 4.7 c23e10a184 feat(audiobooks): DELETE /me/item/{id}/bookmark/{time} — ABS delete
Idempotent: returns 200 with the caller's current bookmark list
regardless of whether the row existed. Skips item validation so
bookmarks remain removable even after the underlying item is deleted.
Realtime user_updated event with reason=bookmark_deleted fires only
when a row actually existed (carries the pre-delete title).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 14:03:35 +02:00
RXWatcherandClaude Opus 4.7 462ce40ef7 test(audiobooks): cover PATCH /me/item/{id}/bookmark upsert semantics
Drives the same handleUpsertBookmark with reason="bookmark_updated",
asserts the (user, profile, item, time) tuple is unique (PATCH updates
title in place, never duplicates) and that the ULID is preserved
across upsert.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 14:01:02 +02:00
RXWatcherandClaude Opus 4.7 29c40f448c chore(audiobooks): drop unused parseBookmarkTime from bookmark handler
The helper was added in advance of the DELETE handler (next task in
the plan) but is unused in this commit, which trips golangci-lint's
unused check. Reintroduce it together with its first caller.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 14:00:01 +02:00
RXWatcherandClaude Opus 4.7 815f207d6c feat(audiobooks): POST /me/item/{id}/bookmark — ABS bookmark create
First of three ABS bookmark endpoints. Body { title, time } upserts on
(user, profile, item, time); response is the item's full bookmark
list. Backed by a new BookmarkStore dependency (nil-safe: handler
returns 503 when unwired). Item validation via MediaStore;
realtime user_updated event with reason=bookmark_created on success.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 13:41:03 +02:00
RXWatcherandClaude Opus 4.7 6ae492be84 feat(audiobooks): add BookmarkStore interface + ABS envelope helper
Defines the storage contract and wire-shape serialiser the bookmarks
handlers will consume. Envelope test asserts the six required keys
(id, libraryItemId, time, title, createdAt, updatedAt) and the
JS-epoch-millis timestamp shape ABS Android pattern-matches on.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 13:36:13 +02:00
RXWatcherandClaude Opus 4.7 a5e430864b chore(audiobooks): drop abs_bookmarks indexes explicitly in down migration
Matches the convention used by 143_abs_playback_sessions and
147_abs_sessions. Functionally a no-op (DROP TABLE cascade-drops owned
indexes), but reads as complete next to its sibling migrations.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 13:34:34 +02:00
RXWatcherandClaude Opus 4.7 1c74a8870d feat(audiobooks): add abs_bookmarks migration (148)
Backs the upcoming ABS-compatible bookmark endpoints. Schema and
rationale documented in
docs/superpowers/specs/2026-05-26-abs-bookmarks-design.md §5.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 13:31:42 +02:00
RXWatcherandClaude Opus 4.7 73b9aca959 docs(audiobooks): Phase 1 sub-project 1 — ABS bookmarks spec
Three-endpoint, per-(user,profile)-scoped bookmark surface for the
Audiobookshelf-compatibility API. Mirrors the canonical continuum
plugin's "key by (item, time)" model, with silo's profile-isolation
overlay and the existing nil-safe socket publish wrapper for
realtime user_updated events. One migration (148_abs_bookmarks),
one new store, one new handlers file. Ready for the implementation
plan once the user signs off.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 11:39:05 +02:00
RXWatcherandClaude Opus 4.7 a902055acf fix(audiobooks): mount /public/session/{sid}/track/{idx} for ABS DirectPlay
Root cause: the official ABS Android client (PlaybackSession.kt:194-200)
on ABS server v2.22.0+ with DirectPlay builds the streaming URL as
"$serverAddress/public/session/$id/track/$index" WITHOUT a token,
ignoring audioTrack.contentUrl entirely. Silo reports version 2.35.0
and emits playMethod: 0 (DIRECTPLAY) but never mounted this route, so
every play attempt 404'd silently — spinner forever.

Add handlePublicTrack: look up the session by sid (ULID as capability,
matches booklore-ng + continuum-plugin behavior), resolve the track by
1-based index against the session's media files, stream via
playback.ServeDirectPlay (Range + HEAD supported). Mounted OUTSIDE
bearerAuth at both /public/session/... and /abs/public/session/... .

6 unit tests cover serve / HEAD probe / unknown session / closed
session / out-of-range / bad-index paths.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 10:56:48 +02:00