Translate 4 new keys across all 33 locales: - Send - Book file is not available locally - Failed to send book - Highlight Current Sentence Also commit pending .claude/memory bug-fix notes. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2.1 KiB
name, metadata
| name | metadata | ||||||
|---|---|---|---|---|---|---|---|
| txt-author-recognition-4390 |
|
Issue #4390: imported Chinese web-novels showed author either missing (未知) or
as an irrelevant metadata blob (e.g. 2024/08/01发表于:是否首发:是字数1023150字116:01).
Key debugging tell: the displayed title was the entire filename including
作者:X (e.g. 【月如无恨月长圆】(1-154)作者:陈西). A real EPUB's dc:title would
be just the book name. Full-filename title ⇒ the file went through Readest's
TXT→EPUB converter (bookService.ts /\.txt$/ → TxtToEpubConverter), which
sets bookTitle = base filename in the no-《》 branch of extractTxtFilenameMetadata.
So "EPUB format" books can still be TXT-origin — check src/utils/txt.ts, not foliate-js,
when title looks like a filename. (Native Rust EPUB parser #4369 was NOT shipped in 0.11.2.)
Two root causes in src/utils/txt.ts:
extractTxtFilenameMetadataonly pulled an author from《》-wrapped names;【】names (the web-novel norm) got no filename author.- Greedy header capture
/[【\[]?作者[】\]]?[::\s]\s*(.+)\r?\n/grabbed a whole noisy metadata line as the author.
Fix:
parseLabeledAuthor(base)extracts the labeled作者:Xfrom ANY filename; title stays the full name. Only the labeled form is safe on a full filename — a bracketed/bare fallback would mistake a leading【title】for the author.isPlausibleAuthorName()rejects a header match that looks like a blob (contains:/:, a\d{4,}run, or length > 20) → falls back to the filename author. Applied in BOTHconvertSmallFileandextractAuthorAndLanguage(large-file path).
Note: the 著 form is handled for file content headers but NOT for filenames (kept minimal).
Reported files were 455 kB / 1.25 MB → both under the 8 MB LARGE_TXT_THRESHOLD_BYTES
(convertSmallFile path). Tests live in txt-converter.test.ts (faithful repro of both
reported strings). Related: bug-patterns.