8000 Read a person's anime staff position without the "add" button text by rombat · Pull Request #673 · jikan-me/jikan · GitHub
[go: up one dir, main page]

Skip to content
< 10000 div class="prc-PageLayout-PageLayoutWrapper-2BhU2" data-width="full">

Read a person's anime staff position without the "add" button text - #673

Merged
irfan-dahir merged 1 commit into
jikan-me:masterfrom
rombat:fix/staff-position-add-prefix
Nov 11, 2026
Merged

irfan-dahir merged 1 commit into
jikan-me:masterfrom
rombat:fix/staff-position-add-prefix

Conversation

@rombat
@rombat rombat commented Nov 11, 2026
Copy link
Copy Markdown
Contributor

A person's anime staff positions all started with "add ", e.g. add Director, Storyboard: the position cell also holds MyAnimeList's "add" (to list) button, and AnimeStaffPositionParser::getPosition() read the whole div. It now reads the <small> holding the position, e.g. Director, Storyboard. Consumers that strip the prefix themselves keep working.

Checked against a live page (/people/185, fetched 2026-11-10): the div still holds the button followed by <small>Theme Song Performance (ED2)</small>.

Testing

With the fixtures branch linked, composer quality:static passes and composer test passes except NewsListItemParserTest::it_gets_the_date, which fails on master too (it expects the recorded news to be less than 30 days old). The commit skips the pre-commit hook for that reason.

The position cell also holds MyAnimeList's "add" (to list) button, so
every position started with "add ". Read the <small> holding the
position instead of the whole div.
@irfan-dahir irfan-dahir left a comment
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified end-to-end, both halves together (fixtures#20 @ b2a2768 + this branch @ 8c81ed9).

What I checked

  • Full suite: 1057 tests / 12304 assertions, the only failure is NewsListItemParserTest::it_gets_the_date (pre-existing real-clock assertion, unrelated — it fails on master today too).
  • PersonParserTest + CorpusTest: 122 tests, 556 assertions, green.
  • Fixtures diff verified field-by-field: exactly 128 position values across the 3 snapshots, every change is add X -> X, no other JSON key touched, all three files still valid JSON.
  • Fixture scan: all 128 staff rows have exactly one <small>; none produce an empty position after the change.
  • Live probe (2026-11-11, /people/185): 58 staff rows, 0 empty, 0 still prefixed.
  • composer quality:static clean (php-cs-fixer, PHPStan, endpoints:check).

Why this is the right shape of fix: //td[2]/div[2]/small is already the house convention — PublishedMangaParser has read exactly that since 2021 and StaffListItemParser reads only //small. The published-manga rows on the same pages also carry the "add" button, so this makes the two person-page tables consistent.

Merge order: jikan CI clones fixtures master, so the two PRs have to land together. fixtures#20 is merged first, so master is red on the 3 person snapshots until this lands — merging it now.

Non-blocking nit: the test pins row 0 only; an assertNotContains('add ', ...)-style guard would also catch a partially updated snapshot. Fine as a follow-up.

@irfan-dahir
irfan-dahir merged commit 83000a8 into jikan-me:master Nov 11, 2026
1 of 7 checks passed
@irfan-dahir
Copy link
Copy Markdown
Collaborator

@rombat Thanks for the PRs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0