feat: add Baka-Tsuki plugin (english) - #2380
Merged
rajarsheechatterjee merged 4 commits intoAug 8, 2026
Merged
Conversation
Adds an English source plugin for Baka-Tsuki, built on the wiki's
MediaWiki API rather than HTML scraping.
- Catalogue unions the English-tagged categories (trusted verbatim) with
the language-agnostic status categories filtered by a language-suffix
pattern, since neither source alone is both complete and English-only.
Cached per session behind a shared promise.
- Search ranks title-first (exact > prefix > substring > token) over the
cached catalogue, augmented by prefixsearch and full-text. Chapter
sub-pages are excluded by catalogue membership plus a strict colon
rule, which holds across languages where enumerating chapter words
("Tome", "Rozdzial", "Tap") does not.
- Chapter lists are read from the project page in document order, the one
place scraping beats the API: allpages is alphabetical and would place
Chapter 10 before Chapter 2. Accepts both the full page title and its
first colon-segment as a prefix, since some projects file chapters
under a short name.
- Volume "Full Text" pages are dropped where individual chapters exist
and kept where they are the only readable entry.
- Genres, status and author are derived from page categories; author is
omitted rather than guessed when it does not look like a personal name.
- Summary prefers a synopsis section, as the lead section is usually wiki
housekeeping.
- showLatestNovels maps to recentchanges, rolled up to parent projects.
Verified against the live wiki across four differently shaped projects
(standard, slash-titled, colon-titled, irregular): 51/51 checks pass.
parseNovel uses 4 requests, parseChapter exactly 1.
Drops the union with the language-agnostic status categories. Those are
now read only to populate the status map, so browse lists exactly the 160
titles in Category:Light novel (English), romanised as the wiki has them.
Also rejects parenthesised translation siblings ("Fate/Zero (Bielarus)")
from search results, which the colon rule did not catch.
Chapters sort by volume ascending with ungrouped entries last. Projects with no sub-pages are hidden from search, verified per-hit so a revived project un-hides itself.
pdmacinnes
force-pushed
the
feat/baka-tsuki-plugin
branch
from
August 5, 2026 04:49
019d26f to
a061b21
Compare
4 tasks
rajarsheechatterjee
approved these changes
Aug 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
1.1.0Adds an English source plugin for Baka-Tsuki.
Baka-Tsuki runs MediaWiki 1.43 with an open read API, so the plugin talks to
api.phprather than scraping rendered pages. That removes the usual wiki-scraper fragilities: sidebar/footer stripping and skin-layout drift.Behaviour
Category:Light novel (English)(160 titles), fetched once per session behind a shared promise and sliced 40/page. Covers batched 50 per request; failures fall back to the placeholder.list=recentchanges, with chapter edits rolled up to their parent project.prefixsearchand full-text. Page 2+ falls through to offset-paginated search.Category:Genre - *, status from the project status categories, author from the author category. Author is omitted rather than guessed when it does not look like a personal name.Notes for review
A few decisions that are not obvious from the diff:
list=allpages&apprefix=is the tidier API route but sorts alphabetically, which places Chapter 10 before Chapter 2. Chapters sort by volume ascending with ungrouped entries last.Anohana: The Flower We Saw That Daykeeps its chapters atAnohana:Part 1 Chapter 1. Both the full title and its first colon-segment are accepted; matching only the former returned zero chapters.Anohana: …), and an English-word list leaked:Tome 1 Chapitre 1,:Tom 1 Rozdział 2,:Tập 2,:Act 1. Catalogue members are exempt, so outside the catalogue any colon disqualifies.exintrois unusable here. Project pages open with wiki housekeeping, so the summary prefers an explicit synopsis section and filters boilerplate.Array.fromover spread for Set/Map iterators, since the repo targets ES5 withoutdownlevelIteration.Verification
Exercised against the live wiki across four differently shaped projects — standard (
Absolute Duo, 58 ch), slash-titled (Fate/Zero, 119 ch), colon-titled (Anohana: …, 24 ch), irregular (Hidan no Aria, 45 ch) — plus missing-page and empty-project handling. All 57 checks pass.Request budget:
parseNovel4 (chapter release times are batched 50/request and capped at 4 batches),parseChapterexactly 1.tsc --noEmit,eslintandprettierare clean locally.Happy to adjust anything to house style.