Repository navigation
Read anime card type and start date from the card's own fields - #656
Merged
Merged
Conversation
Every anime card carries a js-anime-type-N class (numbered like the search
filter) and a hidden js-start_date ("YYYYMMDD", 00 for unknown parts).
AnimeCardParser now reads them first:
- year-only dates ("2027") were read as 20:27 today; now 1 January of that year
- schedule cards got the weekday heading ("Friday") as their type
- producer cards had no type or date; genre cards had no date
- seasonal TV Specials read "TV Special", not their "Special" section heading
The visible text stays as the fallback. AnimeCardHiddenFieldsTest checks the
type map against what genre and seasonal cards show, and every date format.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The PR's mutation run flagged no-op code: casts and isset() around the type map (the regex now accepts only 1-9), trim() and anchors on the hidden date (text() already trims; it is always 8 digits), trim() after cleanse(). The fallback for cards without the hidden date is now tested with "Oct 2027" and a full date with "(JST)", not only a bare year. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 15, 2026
CrafterSama
pushed a commit
to CrafterSama/jikan
that referenced
this pull request
Oct 27, 2026
Moves the accumulated Unreleased entries under "v5.0.0-beta.2 — 2026-10-15" with a short summary, and leaves an empty Unreleased heading. Also moves the anime-card entry from jikan-me#656, which landed in the format template's example "Fixed" section, into the release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Follow-up to #636's "dead branches in
AnimeCardParser". I traced which branch each of the 1,370 anime cards on the recorded genre, producer and seasonal pages takes, and every branch is used, so there is no dead code. The check did turn up a bug and missing data instead.Every anime card carries two fields that we weren't reading:
js-anime-type-Nclass, numbered the same as the search filter (1 = TV … 9 = TV Special, 0 = unknown);.js-start_dateofYYYYMMDD, with00for unknown parts (20270000,00000000).AnimeCardParsernow reads them first and keeps the visible text as the fallback.nullnullgetAnime()says)How partial dates are handled: an unknown month or day falls on the 1st (midnight in Japan, converted to UTC), as "Oct 2027" already did.
00000000givesnull.Tests:
AnimeCardHiddenFieldsTestchecks:Snapshot changes are limited to
typeandairingStart. There's a changelog entry under Fixed.🤖 Generated with Claude Code