Skip to content

fix: codex review batch — history links, thumbnails, music transcode, calibre, SQL params - #63

Open
PetalCat wants to merge 5 commits into
mainfrom
fix/music-transcode-container-apr17
Open

fix: codex review batch — history links, thumbnails, music transcode, calibre, SQL params#63
PetalCat wants to merge 5 commits into
mainfrom
fix/music-transcode-container-apr17

Conversation

@PetalCat

Copy link
Copy Markdown
Collaborator

Summary

Batch of codex review fixes from April 2026 that were implemented in agent worktrees but never pushed or merged. Rolled up via fix/music-transcode-container-apr17:

  • A9 — history feed link format matches canonical /media/ shape
  • A10 — history thumbnails resolve per-service, not hardcoded Jellyfin
  • A12 — music transcode container: align client/server
  • A15 (security) — parameterize computeStats mediaType to prevent SQL injection
  • Adapter: Seerr (Overseerr/Jellyseerr successor) #27 — distinguish empty Calibre library from failed load

Individual fix branches also pushed separately for reference:

  • fix/history-feed-link-format-apr17
  • fix/compute-stats-sql-params-apr17
  • fix/history-thumbnail-paths-apr17
  • fix/calibre-books-investigation-apr17

Test plan

  • History feed links navigate to correct /media/ paths
  • History thumbnails load for non-Jellyfin services (Plex, etc.)
  • Music transcoding works end-to-end
  • computeStats queries are parameterized (no raw interpolation)
  • Empty Calibre library shows "empty" state, not error

🤖 Generated with Claude Code

PetalCat and others added 5 commits April 17, 2026 19:29
The music client was requesting Jellyfin's /Audio/{id}/universal endpoint
with TranscodingContainer=ts, but `ts` is an HLS segment container — the
universal audio endpoint delivers a progressive audio stream. The stream
proxy's own default for that path is `aac` (the canonical wider-compat
choice). Client and server disagreed, breaking playback.

Aligning the client to `aac` so what we send matches what the proxy
would emit if nothing were specified.

Finding A12 from review.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
computeStats() in stats-engine.ts was interpolating `mediaType` directly
into SQL via a template-literal-built `mediaTypeFilter` fragment. Callers
are controlled today, but the `type` query param on /api/user/stats flows
into this function end-to-end — making it a real SQL-injection sharp edge.

Replaces the string interpolation with a parameterized `?` placeholder
by splitting into two prepared statements (with-filter and without-filter),
matching the existing pattern used elsewhere in src/lib/server for
play_sessions queries. No behavioral change for callers.

Audited the remainder of the file: all other queries (media_actions,
interaction_events, stats_rollups upserts) already use `?` binding.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@PetalCat
PetalCat force-pushed the fix/music-transcode-container-apr17 branch 2 times, most recently from 9958ef4 to c485404 Compare May 19, 2026 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant