fix(mangadar): support new rows format and iterate all x-data containers - #17804
fix(mangadar): support new rows format and iterate all x-data containers#17804hamedhani1998 wants to merge 6 commits into
Conversation
- Iterate all div[x-data] instead of single selectFirst
- Support new compact array format: rows: [[id, number, url, timestamp], ...]
- Keep legacy chapters: [{...}] format as fallback
- Add parseRowsJson helper for compact array parsing
Starmania
left a comment
There was a problem hiding this comment.
Please keep the legacy chapters: branch only if you can point at a title that still uses it
MangaDar.kt:221-231, and Dto.kt:22-36
I couldn't find the old format anywhere. Sampled 7 titles spanning 2 to 541 chapters — 877 rows in total:
| title | chapters | format |
|---|---|---|
all-hail-the-sect-leader |
541 | rows: |
blue-box |
247 | rows: |
do-your-best-to-regret |
40 | rows: |
hands-off-my-cleaner |
35 | rows: |
green-skin |
10 | rows: |
bungou-stray-dogs-dazai-wo-hirotta-hi |
2 | rows: |
when-love-calls-upon-me |
2 | rows: |
Every one of those pages has exactly 10 div[x-data], with rows: always in container index 7 and every row of length 5. A \bchapters: search matches nowhere on any of the seven pages.
That makes the legacy branch unreachable, and ChapterDto unreachable with it — Dto.kt:22-36 has exactly one consumer, the parseAs<List<ChapterDto>>() call at :228.
Seven titles is a sample, not a proof, so: if you know of a title that still serves chapters:, name it and the fallback is justified — keep it. Otherwise please delete the legacy branch and ChapterDto along with it. A fallback for a shape that can't be reproduced is speculative, and it's the kind of code that quietly rots. (SearchResponse / SearchMangaItemDto are unaffected.)
6a0c8ce to
35b6724
Compare
This comment was marked as spam.
This comment was marked as spam.
92a5aa4 to
a39c3b9
Compare
Summary
n- Support new compact array format: ows: [[id, number, url, timestamp], ...]n- Keep legacy chapters: [{...}] format as fallback