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

Mangadex doesn't list all chapters given the language #172

Open
luevano opened this issue May 30, 2023 · 7 comments
Open

Mangadex doesn't list all chapters given the language #172

luevano opened this issue May 30, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@luevano
Copy link

luevano commented May 30, 2023

Describe the bug

I'm running into the issue where I'm trying to download JoJo's part 5 colored, and it only lists 70 chapters out of 155. At first I thought it was the issue described at #155 which was said that it was because of external links. It is not the case for this manga.

I tracked it down to the language option, as using "any" shows the correct chapters (and all other languages, too), but "en" stops at 70.

The manga in question is this one (there are 2 with the same name). I've manually checked the API and the chapters are fine.

By using the API directly with the language "en" (https://api.mangadex.org/manga/fd917921-5e97-479f-b22c-5d7f00e1c830/aggregate?translatedLanguage[]=en) gives all the 155 chapters.

I even checked chapter 71, 72 and 73 to see if they had the correct language and if they were not external. I used the API for this too (https://api.mangadex.org/chapter/ecbda659-532a-401f-8585-d6025bf745fe, change the id for whatever chapter id).

Why is 500 added to the offset at line 60-63 at chapters.go?, looks like it would be added too often... and all "en" chapters are available. Also lines 86-92 are both out of the for loop, maybe this is a bug?

Reproduction steps

  1. Search for "Jojos colored" using built in Mangadex (using language "en").
  2. Select "JoJo's Bizarre Adventure Part 5: Vento Aureo" (fd917921-5e97-479f-b22c-5d7f00e1c830).
  3. It will only show 70 chapters.
  4. Using the API we can see that for "en", there are 155 chapters (https://api.mangadex.org/manga/fd917921-5e97-479f-b22c-5d7f00e1c830/aggregate?translatedLanguage[]=en).
  5. We can check that chapter 71 is "en" and externalUrl is null (https://api.mangadex.org/chapter/ecbda659-532a-401f-8585-d6025bf745fe).
  6. Do the same search with "any" as language, and the correct "en" 71 chapter will be found (id ecbda659-532a-401f-8585-d6025bf745fe). This might require to delete the mangal cache.

Expected behavior

To actually list all chapters with the specified language.

Additional context

No response

Operating System

Linux

@luevano luevano added the bug Something isn't working label May 30, 2023
@luevano
Copy link
Author

luevano commented May 30, 2023

Ok, found the issue, already fixed on my local. It is an issue with the offset. The way it is meant to work is to use an offset to get chunks of chapters (500 per is the max). The issue was that the offset was increased by 500 each time the language was not met, so the chapters after 500 where lost due to the offset being grater than the total of chapters.

Will be creating a PR for this once I figure out how to do so lol.

@luevano
Copy link
Author

luevano commented Jun 1, 2023

It's fixed by the two commits on the closed pull request, if needed you can get those from my fork.

@jorgejung
Copy link

Still have the same issue

@shinji257
Copy link

This seems to have fixed it for my local build. Had to clear cache for the change to become effective.

@jorgejung If you are still having the issue then clear the cache for mangal. On Windows it is in Local Appdata. I don't know where it is on other platforms (if it matters).

@luevano
Copy link
Author

luevano commented Jan 18, 2024

@shinji257 you might be using a different fork, because the bug still exists in this code, for a more updated version you could use https://github.com/Belphemur/mangal or my fork (heavily different, so not a drop-in replacement yet)

@shinji257
Copy link

@shinji257 you might be using a different fork, because the bug still exists in this code, for a more updated version you could use https://github.com/Belphemur/mangal or my fork (heavily different, so not a drop-in replacement yet)

I'm using this repo + the two commits you indicate fixes it. That's what I mean when I say "this seems to have fixed it". I had to clear cache out for mangal so it could pull the data again but for the one manga where I hit it then it pulled fine after. It might be that I need to have a larger manga to check for it still happening.

I'll give the forks you indicated (yours and mangal) a go sometime to see how they work out for me.

@luevano
Copy link
Author

luevano commented Jan 18, 2024

@shinji257 you might be using a different fork, because the bug still exists in this code, for a more updated version you could use https://github.com/Belphemur/mangal or my fork (heavily different, so not a drop-in replacement yet)

I'm using this repo + the two commits you indicate fixes it. That's what I mean when I say "this seems to have fixed it". I had to clear cache out for mangal so it could pull the data again but for the one manga where I hit it then it pulled fine after. It might be that I need to have a larger manga to check for it still happening.

I'll give the forks you indicated (yours and mangal) a go sometime to see how they work out for me.

Ah I see, my bad I didn't read correctly I thought you said something in the lines of "it fixed by itself for me" for some reason. I'm not sure if Belphemur implemented the fix but you could check. If you check mine (uses updated version of v5 branch from metafates, with some updates for myself) just expect things to break (it will complain about the mangal config); ping me/open an issue on my repo/PR and I'll happily look into it. Belphemur is also pretty active and has added a ton of stuff and updated his version, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants