fix: update Anime Anyway for current site schema - #2570
pdmacinnes wants to merge 4 commits into
Conversation
Reads the site's embedded Next.js page data (__NEXT_DATA__) instead of scraping rendered HTML: volume/chapter lists and chapter bodies (Sanity Portable Text) come straight from the JSON the site itself was built from. Volumes titled "Year N Vol. M" are grouped into one novel per year since no single page represents an entire year; everything else is its own standalone novel.
Each Classroom of the Elite volume is published as its own distinct book, so list them separately instead of merging same-year volumes into one novel. Drops the grouping/synthetic-path machinery entirely -- every novel path is now just the site's own real volkeyword.
|
| return volume.series && volume.seriesUsesRootPath === false | ||
| ? `${volume.series}/${volume.volkeyword}` | ||
| : volume.volkeyword; |
There was a problem hiding this comment.
New routes lack test coverage
The series-prefixed path depends on seriesUsesRootPath being exactly false, but no fixture-backed test checks that the catalogue produces nibunnoinochi/v1. The new volumeProps.vol parsing branch is untested too. Tests for both payload shapes and routes would catch a site-data mismatch that lint and type-checking cannot.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Thanks. This repository has no dedicated unit-test or fixture harness; its documented validation is the live plugin check. I verified the new nibunnoinochi/v1 route and both payload handling paths against the live site successfully. Fixture coverage could be added separately if the project adopts a test framework.
Summary
Verification
The branch is synced with upstream master so the PR is ready for review.