Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve GigaViewer chapter list parse to fix NullPointerException #6514

Merged
merged 2 commits into from
Dec 8, 2024

Conversation

hatozuki-programmer
Copy link
Contributor

Closes #4993
Closes #5410

Utilizes a more generic method of getting chapter information that resolves compatibility issues with sites that use a paginated version of the GigaViewer chapter list.

The number_since query parameter needs to be a number that is at least the number of chapters in the series, minus one. As a series is unlikely to have more chapters than Int.MAX_SIZE I've chosen to use that as the the value.

The read_more_num query parameter appears to max out at 150, any values above this result in an error message in the response.

Checklist:

  • Updated extVersionCode value in build.gradle for individual extensions
  • Updated overrideVersionCode or baseVersionCode as needed for all multisrc extensions
  • Referenced all related issues in the PR body (e.g. "Closes #xyz")
  • Added the isNsfw = true flag in build.gradle when appropriate
  • Have not changed source names
  • Have explicitly kept the id if a source's name or language were changed
  • Have tested the modifications by compiling and running the extension through Android Studio
  • Have removed web_hi_res_512.png when adding a new extension

Uses a more generic method of getting chapter information that resolves compatibility issues caused by sites that use a paginated version of the GigaViewer chapter list
@MikeZeDev
Copy link
Contributor

MikeZeDev commented Dec 7, 2024

Turns out, the endpoint i got on Sunday Web Every returns proper JSON elements and not a html string we have to parse

https://github.com/manga-download/haruneko/blob/7d93b3fea8ce69eaf0e8650ca1dd62584f6fd94a/web/src/engine/websites/SundayWebry.ts

Comic Growl :

image

Sunday Webry

image

Perhaps you'd rather deal with JSON pure data and not having to parse some HTML after?

The endpoint ive found is not available on every websites tho 😢

@hatozuki-programmer
Copy link
Contributor Author

@MikeZeDev Thanks for bringing that endpoint to my attention. From some testing I've done, it appears to only be available on sources that use a paginated chapter list, such as Sunday Web Every and Tonari no Young Jump. While it would be preferable to deal with JSON rather than parsing the HTML, the generic solution presented in this PR works across the board for all GigaViewer sources, so I'd rather stick with that than maintain two separate solutions.

Perhaps future versions of GigaViewer will open up that endpoint (or a similar one) allowing us to use it for all GigaViewer sources.

@vetleledaal vetleledaal merged commit a0467ce into keiyoushi:main Dec 8, 2024
23 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tonari no Young Jump - NullPointerException: null [Kurage Bunch] error when refreshing chapter list
3 participants