mirror of
https://github.com/readest/readest.git
synced 2026-11-29 19:02:28 +00:00
6 commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
771b152e5b
|
feat(dictionaries): add bundled plugin and Yomitan support (#5764)
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (rust) (push) Waiting to run
Publish Docker image / build (linux/amd64, ubuntu-latest) (push) Waiting to run
Publish Docker image / build (linux/arm64, ubuntu-24.04-arm) (push) Waiting to run
Publish Docker image / merge (push) Blocked by required conditions
PR checks / rust_lint (push) Waiting to run
PR checks / koplugin_rust_lint (push) Waiting to run
PR checks / build_web_app (push) Waiting to run
PR checks / test_web_app (1) (push) Waiting to run
PR checks / test_web_app (2) (push) Waiting to run
PR checks / test_extensions (push) Waiting to run
PR checks / build_tauri_app (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Deploy to vercel on merge / build_and_deploy (push) Waiting to run
* feat: add bundled dictionary plugins and Yomitan support * fix: serve browser plugin workers with COEP * feat: add portable and batched Yomitan imports * feat: show dictionary import progress * fix: pre-landing review fixes * fix: pre-landing review fixes * fix: pre-landing review fixes * fix: isolate malformed portable dictionary rows * fix: bound and isolate portable plugin results * fix: harden plugin data boundaries * fix: isolate portable dictionary rows * fix: isolate dictionary plugin failures * fix: preserve dictionary rollback targets * fix: guard dictionary generation recovery * docs: document dictionary plugin architecture Co-Authored-By: OpenAI Codex <noreply@openai.com> --------- Co-authored-by: OpenAI Codex <noreply@openai.com> |
||
|
|
9dedaf8042
|
feat(reader): pair local audiobooks with ebooks (#5754)
* feat: pair local audiobooks with ebooks * refactor: use daisyui steps for audiobook pairing * fix(qa): #5741 seek within audiobook tracks * fix: #5741 align audiobook narration with reader location * fix: pre-landing review fixes * fix: pre-landing review fixes * fix: pre-landing review fixes * fix: release audiobook preview listeners * fix: serialize audiobook narration teardown * docs: document local audiobook pairing Co-Authored-By: OpenAI Codex <noreply@openai.com> --------- Co-authored-by: OpenAI Codex <noreply@openai.com> |
||
|
|
7fa3daa19d
|
feat(tts): queue chapter downloads with per-book persistence (#5690)
* feat(tts): queue chapter downloads with per-book persistence Replace the cancel-and-replace download flow with a persistent per-book download queue mirroring the cloud-sync transfer queue (transferStore + transferManager). - ttsDownloadStore: zustand queue of chapter rows (pending/in_progress/ failed) keyed by bookHash:chapterKey, with section-range snapshots so restored rows download without re-resolving the TOC; interrupted runs demote to pending on restore. - ttsDownloadManager: sequential single-slot processor bound to the live TTS session, per-item AbortController, batch priority for Download all, localStorage persistence, and removeBook cleanup on book deletion. - Player sheet: Spotify-style row badges (queued clock, active ring, failed/partial resume arc) and a Download all / Cancel all toggle. - Fixes a race where starting a second download left the first run's teardown resetting the shared progress state, silently stalling every subsequent download until restart. * fix(tts): make offline downloads durable and race-safe Use stable book identities and per-attempt ownership for the persistent queue. Pin explicit downloads in SQLite so cache eviction, cancellation, and restart recovery cannot discard them. * fix(tts): join playback teardown before deleting audio Centralize local-book cleanup in the app service and track controller shutdowns per book. Deletion now waits for active synthesis and cache handles to settle without clobbering replacement reader sessions. * feat(tts): finish persistent offline audio queue controls Key the reader UI by stable book hash, expose pending, active, failed, retry, cancel-all, and clear-all states, and prevent stale refreshes or clear/download races. * docs: document persistent offline audio downloads Co-Authored-By: OpenAI Codex <noreply@openai.com> * fix(i18n): add en plural forms for the Cancel all count key Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Huang Xin <chrox.huang@gmail.com> Co-authored-by: OpenAI Codex <noreply@openai.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com> |
||
|
|
85deb8d357
|
feat(sync): add cloud shelves and safe provider deletion (#5701)
* feat(sync): preserve remote files and sync cloud shelves * docs: document third-party file sync behavior Co-Authored-By: OpenAI Codex <noreply@openai.com> --------- Co-authored-by: OpenAI Codex <noreply@openai.com> |
||
|
|
35450e965a
|
feat(tts): play a book's own recorded narration (EPUB 3 Media Overlays) (#5480)
* feat(tts): play a book's own recorded narration (EPUB 3 Media Overlays)
Read Aloud always synthesized speech, so a professionally narrated read-along
EPUB was read by a robot voice over a book that came with a human one. Play the
recording instead, keeping the entire existing Read Aloud experience: moving
highlight, page-following, sentence/paragraph skip, scrubber and seek, speed,
sleep timer, lock-screen/CarPlay, and background sessions.
This is the Kindle Immersion Reading / Audible Read & Listen experience built on
the open EPUB standard rather than a store-side pairing of two purchases: no
account, no matching entitlements, any narrated EPUB you own or generate.
The stack already had the two seams this needs. `TTSClient` abstracts where audio
comes from; foliate's `TTS` abstracts how text is cut into marks. Recorded
narration is exactly "a different audio source with a different segmentation", so
`src/services/tts/mediaOverlay/` swaps both and leaves the other ~25 files of the
subsystem untouched:
- `parseSmil.ts` parses SMIL clock values and walks <body>/<seq>/<par>.
- `MediaOverlaySection.ts` resolves each par's text fragment to a DOM Range,
groups pars into blocks by nearest block ancestor, and emits the SSML.
- `MediaOverlayTTS.ts` stands in for foliate's TTS with the same navigation
surface, driven by the par list.
- `MediaOverlayClient.ts` plays clips off one HTMLMediaElement, emitting a
boundary as each par becomes audible.
Marks are section-global par ordinals, so marks and audio clips are 1:1 by
construction and there is no text-to-audio matching anywhere in the feature. A
block plays as one continuous span, so a narrated sentence has no seam mid-way.
Selection reuses the Voice picker: the narrator leads the list for books that
carry overlays, and is preselected. `ttsUseNarration` on TTSConfig records the
per-book opt-out, separate from `ttsVoice` because that inherits the global
default. Offline Audio is hidden during narration, since the audio ships inside
the book. Narrated books get a headphones badge in the library, from a
`Book.hasNarration` flag cached at import time.
Highlighting follows the recording exactly rather than interpolating within a
clip, so it cannot drift. Sections the publisher left unnarrated are skipped.
Alignment stays out of scope: a bare MP3 carries no timings and generating them
would mean shipping a speech-recognition model. docs/read-along-narration.md
points at Storyteller for turning an ebook plus its audiobook into a Media
Overlays EPUB, and is honest about the evidence on reading-while-listening: the
comprehension benefit is trivial overall (g=0.18) and only appears when reading
is externally paced, which is why this is a preference and not a prescription.
Two supporting changes:
- `TimelineSentence.duration` carries the exact clip length and outranks the
measured/estimated tiers in SectionTimeline, so a narrated chapter's scrubber
reports the recording's real duration. Deliberately not routed through the
text-keyed cache in ttsDuration.ts, where two identical sentences collide.
- ensureTimeline/supportsPlaybackInfo/getPlaybackInfo now gate on
`TTSCapabilities.mediaClock` instead of comparing against the Edge client.
Verified end to end in a browser against the W3C Moby-Dick MO sample and a
330 MB Storyteller-generated novel: narration selected automatically, unnarrated
front matter skipped, real audio decoded and played at the user's rate with pitch
preserved, boundaries firing per par across block boundaries, the narrated
sentence visibly highlighted, and the scrubber showing the recording's exact
elapsed/remaining time. That pass found four defects no jsdom test could reach:
element-anchored ranges producing a degenerate CFI so the highlight never
painted, typeless container blobs failing to decode, five concurrent loads of the
same audio file revoking each other's URLs, and a WrongDocumentError that killed
the session whenever the first sections were unnarrated. All four are fixed and
covered by regression tests.
It also surfaced a pre-existing hang: WebSpeechClient.init() waited forever for a
'voiceschanged' event on a platform reporting zero speech voices, wedging
TTSController.init() and so blocking every engine, including narration, which
needs no system voice. It now gives up after a timeout.
* fix(tts): let recorded narration play on instead of re-seeking each paragraph
Media Overlay clips are contiguous and in document order, so sequential
narration needs no seeking at all: the element can simply keep rolling while
boundaries are reported as the clock passes each clip.
It was instead seeking to clipBegin at the start of every block, because the
controller drives one speak() per paragraph. Detecting a clip's end by polling
the media clock always lands a few milliseconds PAST clipEnd, so those
milliseconds of the next clip had already been heard; seeking back replayed
them, audible as a stutter on the paragraph's first word ("Me? ... Me?").
Now the playhead only moves for a genuine discontinuity (session start, a
sentence skip, a scrub, a new audio file), decided from the element's own
position rather than from bookkeeping. Measured over a minute of The Player of
Games: one seek, at startup, and none across four paragraph boundaries.
Also stop padding paragraph transitions for a continuous timeline. The new
TTSCapabilities.continuousTimeline says consecutive blocks are one recording,
so the controller's inter-paragraph delay would add silence the narrator never
left and push the highlight behind the voice.
* fix(tts): stop putting a gap between paragraphs of recorded narration
Every paragraph boundary was audible as a hiccup, most obviously on the short
"Me?" that opens a paragraph early in The Player of Games. The recording was
being silenced and restarted at each boundary: the client paused at its block's
last clip, and the controller's pre-speak stop() paused again, ~50ms before the
next block called play(). On Android that also costs a buffer flush.
Silencing the engine between utterances is right for synthesis, where each
utterance is separately rendered audio, and wrong for one continuous recording,
where the next utterance is the same audio playing on. So stop() now takes a
`handover` flag for the stop the controller performs between two utterances of
the same session: a continuous-timeline engine stays rolling through it, and
engines that synthesize per utterance ignore it and stop as before.
The narration client therefore leaves the element playing when a block ends and
lets the next block join it in progress. A watchdog covers the case where no
next block comes (a one-off selection read, or a session torn down without
stopping), so narration can never be left running unattended.
Measured over 80s of The Player of Games, sixteen sentences across five
paragraph boundaries: no seeks, no pauses, and no stall in the media clock.
* fix(tts): read a selection aloud from the recording when a book is narrated
Selecting text and pressing Read Aloud played for about a second and then
stopped the whole session. The selection path builds SSML from the raw selected
text, which is right for a synthesizer but meaningless to the narration client:
its marks are SMIL par ordinals, so raw text matched no clip, the utterance
ended immediately, and the one-shot callback stopped the session.
A recording has no audio for arbitrary text, only the clips the publisher timed,
so reading a selection from one means starting the narration where that passage
is narrated, via the same tts.from(range) used for any other jump. It is an
ordinary session from that point, not a one-shot utterance, so the one-time
callback no longer applies.
* docs(tts): update the narration notes for the playback fixes
The playback fixes changed how the client drives the media element, so the
"how it works" notes described behaviour that no longer exists: it no longer
seeks at the start of every block, and the capability object it reports gained
continuousTimeline. Record both, plus the handover seam on stop(), the two
defects that surfaced only by listening, and the selection-read fix.
* docs(tts): trim the narration notes to what the code needs
Drop two sections that had grown past the point of earning their place in a
feature doc. The reading-while-listening literature review was an argument about
whether the feature is worth having rather than documentation of how it works,
and the defect postmortem duplicated detail the commit messages already carry.
Keeps the paragraph describing the Media Overlays format itself, which is
reference material the rest of the document depends on.
* fix(tts): follow the reading position across a page break inside a sentence
A sentence laid out across a page break left the reader behind: its mark fires
once, on the page it starts on, and a phrase-timed recording reports no words in
between, so the view stayed put while the voice read the tail rendered on the
next page. Measured at 6.5 seconds on one sentence of The Player of Games.
Synthesized engines hide this by following each word.
What a recording does give is how far through the current phrase its audio is,
now exposed as TTSClient.getChunkProgress(). Where the page stops showing the
sentence cannot be assumed — the same sentence breaks at a different word on
another screen, at a larger font size, or in a narrower column — so it is
measured from the live layout: pageBreakFraction bisects the sentence, probing
characters through getTextSubRange, and returns the break as a fraction of the
sentence's text, which is the unit that tracks how long the narrator spends on
it. Bisection is not tidiness — every probe forces a reflow.
The page turns once audio progress passes that fraction, and the fraction is
re-measured after each turn, so a sentence spanning three pages advances one page
at a time. No word position is invented, so the highlight still follows the
recording exactly. Engines without a chunk clock report no progress and keep
their existing behaviour.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(tts): keep the back-to-position prompt down when the view follows the voice
Following the voice onto the next page moves the view past the *start* of the
sentence being read, and that start is what ttsLocation records. Judged on it
alone the reader looks like they navigated away, so the prompt appeared on every
page turn — while they were in fact looking at the words being spoken. Engines
that report words dodge this because their highlight cfi moves with the voice; a
phrase-timed recording has no such cfi.
So ask the layout instead: isSoundingSentenceOnScreen() reports whether any part
of the sentence now sounding is still on the visible page, and the prompt stays
down while it is. Paging away from the sentence entirely still raises it.
Also rename the prompt from "Back to TTS Location" to "Back to Read Aloud",
after the name the feature actually carries in the UI, and drop the "TTS" jargon
from all 33 locales — several of which had been carrying the acronym untranslated.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Sacha Lastow <sacha.lastow@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
||
|
|
60203a8dc3
|
docs: add architecture and code-layout guides (#4265)
Add two complementary English documents under apps/readest-app/docs/ to help new contributors ramp up on the Readest codebase: - code-layout.md: directory-level inventory of the monorepo, covering apps/readest-app, packages/, the Tauri native shell, workers, and the conventions used for stores, services, and components. - architecture.md: high-level architecture with Mermaid diagrams. Maps the three runtimes (browser webview, Tauri Rust host, Next.js server), the dual API routers (pages/api legacy + app/api), Zustand stores, AppService / DatabaseService abstraction with its three backing implementations, foliate-js / pdfjs / simplecc / jieba integration, and cross-cutting subsystems (sync, cloud library, AI/RAG, translation, TTS, dictionaries, OPDS, Hardcover/Readwise, annotations, Send to Readest). Also documents the COOP/COEP middleware, allow_paths_in_scopes security gate, and the runtime re-config trick used for the single-image Docker deploy. No code changes; documentation only. |