question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

manga.lastChapter is returning different value from manga.getFeed()

See original GitHub issue

Hi all, I noticed the value for manga.lastChapter is different from manga.getFeed()

const manga = await MFA.Manga.get('32d76d19-8a05-4db0-9fc2-e0b0648fe9d0');
manga.lastChapter // 108

const feeds = await manga.getFeed({
        limit: Infinity,
        translatedLanguage: ["en"],
        "order[chapter]": "desc",
      });

feeds[0].chapter // 144

Not sure this is a bug, or I understand the feed chapter id wrongly

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
md-ycommented, Jun 6, 2021

lastChapter and lastVolume are both returned as attributes of manga objects returned by Mangadex, so they are included as a part of the Manga class. Their values seem to be dependent on the default feed order because the first chapter based on default order seems to be the same as the Manga attribute.

However, this seems incorrect as @johnlim5847 described (this chapter is ahead by 40+ chapters). Therefore, this may be a bug on Mangadex’s end or I am misunderstanding it, so for now only use lastChapter/lastVolume as representations of the chapter number and volume number of the first chapter in the default feed. For any other context, using a feed request with a limit of one to get the most recent/highest-number chapter in a certain language seems like the best option.

On another note, during previous versions of the official MD API, lastChapter contained non-number titles, but while researching this issue, it seems that all occurrences of this attribute have become numbers like lastVolume, so the type of Manga.lastChapter may become a number like Chapter.chapter in the next version.

1reaction
Curstantinecommented, Jun 6, 2021

.lastChapter returns a string because it’s not a function, it only gives you the lastChapter field returned by the response.
getFeed() is a function that returns chapter data from the /manga/id/feed.

image image

https://api.mangadex.org/docs.html#operation/get-manga-id

https://github.com/md-y/mangadex-full-api/blob/934d7e0ef342d8a87171a4aaf69067076af45046/src/structure/manga.js#L85

https://github.com/md-y/mangadex-full-api/blob/934d7e0ef342d8a87171a4aaf69067076af45046/src/structure/manga.js#L393

Read more comments on GitHub >

github_iconTop Results From Across the Web

mangadex-full-api - npm
Represents a relationship from one Mangadex object to another such as a manga, author, etc via its id. APIRequestError. This error respresents ...
Read more >
A Beginner's Guide to Manga | The New York Public Library
Here, we break down the basics you need to know before delving into the wide, fantastic world of Japanese graphic novels, a.k.a manga....
Read more >
Hunter x Hunter manga returning this month - Polygon
After four years, the Hunter x Hunter manga is returning on Oct. 23, simulpubbing in both English and Japanese via Shonen Jump.
Read more >
10 Manga That Went On Hiatus And Never Came Back - CBR
Fans are frustrated when their favorite manga goes on hiatus. It's even worse when there's no sign of the series' return.
Read more >
mangadex-full-api: Versions - Openbase
For example includes[]=author for a manga request will return the manga object along with the author object ... getFeed() , Chapter.get() , and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found