Skip to content

Audiobooks from the database: hide course narration, instructor uploads - #263

Merged
AQIB-NAWAB merged 1 commit into
mainfrom
fix/hide-course-audiobooks
Nov 23, 2026
Merged

AQIB-NAWAB merged 1 commit into
mainfrom
fix/hide-course-audiobooks

Conversation

@AQIB-NAWAB

Copy link
Copy Markdown
Collaborator

What

The Audiobooks shelf listed every course with narration (24 books), built from audio.edorax.com manifests. That is course content we do not want exposed. This PR removes those books from the shelf and makes audiobooks standalone, stored in the database, uploaded by instructors.

Changes

  • Database: new Audiobook and AudiobookTrack tables (migration 20261123120000_audiobooks, only adds tables).
  • Public API /api/v1/audiobooks: published books only. Audio is streamed from the private R2 bucket with range support. Unpublishing closes the audio at once.
  • Instructor API /api/v1/teach/audiobooks: create, edit, upload MP3 chapters (up to 50 MB each), reorder, rename, remove, publish, unpublish, delete. Owner or admin only.
  • Teach workspace: /workspace/audiobooks (list) and an editor page, plus a sidebar link.
  • Learner pages: /audiobooks and the book page read from the API. Books have numbered chapters, no parts. The old course manifest code is removed.

Tested

  • Server: typecheck, lint, 7 new API tests (access rules, upload, range, publish, reorder), catalog tests.
  • Frontend: typecheck, 4878 unit tests, new tests for the API mapping.
  • Local end to end with a fake S3 server: upload, publish, shelf, book page, range requests through the Next.js proxy, old course link gives 404.

Not tested

  • The instructor editor in a browser, the real upload button and browser-side chapter length detection.
  • Real R2 and large uploads (up to 50 MB) through the Vercel proxy. Please try one on the preview.

Before or after merge

  • Run the migration on production.
  • Not changed: the Listen player on course chapters, the public files on audio.edorax.com, and the desktop app (it still lists course audiobooks).
  • Frontend lint has 6 errors in files this PR does not touch.

🤖 Generated with Claude Code

…udiobooks

The Audiobooks shelf was built from every course with narration on
audio.edorax.com. Those books are course content we do not want exposed.

Audiobooks are now standalone books stored in the database:
- Audiobook and AudiobookTrack tables, with a migration.
- Public API (/api/v1/audiobooks): published books only, audio streamed
  from the private R2 bucket with range support.
- Instructor API (/api/v1/teach/audiobooks): create, edit, upload MP3
  chapters, reorder, rename, remove, publish, unpublish, delete. Owners
  and admins only.
- Teach workspace pages at /workspace/audiobooks.
- The learner shelf and book page read from the API. Course narration is
  no longer listed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@AQIB-NAWAB
AQIB-NAWAB merged commit dfb6942 into main Nov 23, 2026
8 checks passed
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