Commit graph

27 commits

Author SHA1 Message Date
Richard Roberson
b576910523 refactor(client): centralize client-side API calls and refine types
Abstracted direct fetch calls across components and contexts into new functions within `src/lib/client.ts`. This provides a consistent and centralized interface for interacting with backend APIs.

- Introduced `src/lib/client.ts` to encapsulate API request logic.
- Standardized audio buffer types (`TTSAudioBuffer`, `TTSAudioBytes`) in `src/types/tts.ts`.
- Moved client-specific request types (`TTSRequestPayload`, `TTSRequestHeaders`, `TTSRetryOptions`) to `src/types/client.ts`.
- Updated API routes and consumer components/contexts to leverage the new client library functions and type definitions.
- Removed `src/utils/audio.ts` as its utility functions are now part of `src/lib/client.ts`.
2025-11-21 23:33:41 -07:00
Richard Roberson
cc0372405f chore(env): hide audiobook export button in production 2025-11-16 21:41:25 -07:00
Richard Roberson
ff150eec01 refactor(audiobook): standardize chapter regeneration APIs and UX
- Removed `onProgress` callback from `regenerateChapter` and related functions across `TTS`, `EPUB`, and `PDF` contexts to simplify the chapter regeneration API.
- Updated `AudiobookExportModal` to align with the refined regeneration API, including removing granular chapter progress display and adding a hint about TTS caching behavior.
- Introduced `TTSAudiobookChapter` interface and renamed `ContinuationMergeResult` to `TTSSmartMergeResult` and `PageTurnEstimate` to `TTSPageTurnEstimate` for better type consistency and clarity.
- Applied minor styling adjustments to buttons and listbox components in modals for visual consistency.
- Added `'use client'` directive to several client-side components for Next.js 13+ compatibility.
- Updated Dockerfile build command from `pnpm run build` to `pnpm build`.
- Added Playwright tests to verify backend chapter state after regeneration.
2025-11-16 21:10:32 -07:00
Richard Roberson
42665884d7 feat(audiobook): add chapter-based export with UI and API
Introduce end-to-end chapterized audiobook generation with persistent
storage, resumable workflows, and MP3/M4B support.

API:
- add /api/audio/convert/chapter (GET/DELETE) for per-chapter ops
- add /api/audio/convert/chapters (GET/DELETE) for listing/reset
- enhance /api/audio/convert:
  - accept mp3|m4b, stream combined file, cache complete output
  - robust chapter indexing, docstore persistence, list concat
  - AbortSignal-aware ffmpeg/ffprobe, 499 on cancel

UI/UX:
- add AudiobookExportModal with progress, resume, regenerate, download
- add ProgressCard, enhance ProgressPopup (click-to-focus, richer info)
- add Header, ZoomControl; move TTSPlayer to sticky bottom bar
- redesign EPUB/HTML/PDF pages for full-height layout and controls
- add HomeContent; compact uploader variant; document list polish

TTS/Contexts:
- EPUB/PDF contexts now generate per-chapter to disk, return bookId
- support chapter regeneration; progress/cancel propagation
- pass provider/model/instructions; standardize MP3 TTS output
- HTML context updates for model/instructions

Styling:
- globals: overlay-dim, scrollbar styles, prism gradient utilities
- theme vars: secondary-accent, prism-gradient; tailwind color addition

Misc:
- fix PDF scale calc to use container height
- EPUB theme reader area fills height
- time estimation update cadence stab
- audio util passes format to combine endpoint
2025-11-11 13:32:30 -07:00
Richard Roberson
e8008b68ab Save last EPUB location 2025-02-10 11:49:49 -07:00
Richard Roberson
707dd9261a EPUB Working Well 2025-02-09 11:52:42 -07:00
Richard Roberson
7d667b2114 Prepare epub work 2025-02-08 13:07:36 -07:00
Richard Roberson
ca1e3a83a9 Better mobile styling 2025-01-28 18:14:33 -07:00
Richard Roberson
ced82d7bf5 Allow 300% zoom 2025-01-26 23:14:56 -07:00
Richard Roberson
f9ab9190c2 Add button animations 2025-01-26 20:43:42 -07:00
Richard Roberson
55919310a5 Add different view modes 2025-01-26 18:34:31 -07:00
Richard Roberson
92ee491363 Apple web app capable changes 2025-01-26 16:49:05 -07:00
Richard Roberson
21e1b8f9ca Another build fix 2025-01-26 03:02:32 -07:00
Richard Roberson
8495e4212d Document load fix 2025-01-26 02:33:41 -07:00
Richard Roberson
9374d3efbe Build fixes 2025-01-26 02:15:14 -07:00
Richard Roberson
43d34fb2f7 Fix 2025-01-25 23:55:07 -07:00
Richard Roberson
34d9d4715c Fix increment page 2025-01-25 23:47:19 -07:00
Richard Roberson
429ec3f264 Single page viewer + Major refactor 2025-01-25 22:23:29 -07:00
Richard Roberson
d78be686c1 Add better zoom + controls 2025-01-22 13:34:48 -07:00
Richard Roberson
23d7fae8c2 Add api settings to settings modal + fix README.md 2025-01-22 09:50:47 -07:00
Richard Roberson
9823cd9596 Fix refreshing issue 2025-01-19 20:27:39 -07:00
Richard Roberson
728eb185b7 Rename /context --> /contexts 2025-01-19 14:45:32 -07:00
Richard Roberson
51352943c6 First reasonably okay version 2025-01-19 00:14:32 -07:00
Richard Roberson
355e4ebe29 Use indexed db 2025-01-18 21:59:02 -07:00
Richard Roberson
ae8eb084c2 Update 2025-01-18 13:04:38 -07:00
Richard Roberson
8263a84e40 Working 2025-01-18 05:38:13 -07:00
Richard Roberson
5ecd54a0be First push 2025-01-18 04:58:57 -07:00