TheNetsky / community-extensions

A repo with community made Paperback sources.
https://thenetsky.github.io/community-extensions/0.8
GNU General Public License v3.0
13 stars 31 forks source link

Mangadex: Latest Updates doesn't respect language setting #47

Open milesoc opened 3 months ago

milesoc commented 3 months ago

When showing latest updates, Mangadex appears to pull from the latest updates in all languages.

I suspect that signing in (with an account set to load certain languages only) might help, but https://github.com/TheNetsky/community-extensions/issues/29 prevents testing this.

henderea commented 3 months ago

Signing in won't do much of anything. I know that in the MD website, the "latest update" sort order includes updates in all languages. It doesn't seem to be a language-specific property in the data. So I don't think there is a whole lot the PB source can do when the MD website has the same issue.

milesoc commented 3 months ago

Interesting, I'll try to dig in, now that I've got it building. I know that I can set "chapter languages" in Mangadex to English only, and the Latest Updates page (/titles/latest) returns only English titles on the web. But perhaps that's web-only.

For those who want to explore this: The API does indeed seem to lack this functionality. Latest chapters (vs latest manga) would filter more accurately on language: https://api.mangadex.org/docs/redoc.html#tag/Chapter/operation/get-chapter

However, this would make the latest category useless when someone uploads in bulk. There might be a way to do that filtering on the device side, which is where I'll try next. Not yet sure whether that level of logic is supported.

henderea commented 3 months ago

Well, limiting it to English titles is one thing. The issue I see is that it doesn't seem like that English-only stuff applies to the last updated sort order.

milesoc commented 3 months ago

I have it working here:

https://github.com/TheNetsky/community-extensions/compare/0.8...milesoc:community-extensions:0.8

As of this moment, I have an issue with the second request I have to make to fetch the cover pages, so it looks ugly (always shows the default cover image). But I've confirmed that what I'm fetching matches this page: https://mangadex.org/titles/latest (with language set to English on the site).

I also know I still have an issue where, if too many chapters are uploaded at once, the homepage may only render a couple of manga - I would have to keep running down the pagination within the homepage to fix that. But expanding Latest Updates does work and paginate correctly.

(edit: In this case, there's no duplicate removal between pages either, therefore I need to figure out how to record all the manga that have been found across every paged request and deduplicate at that stage)

milesoc commented 3 months ago

Have it pretty much working on the same diff. A few covers still don't load - if someone knows better than I how to log output to the application logs properly I could probably get that fixed.

It is a little slower than just loading chapters directly - it has to fetch cover art separately - so if y'all don't want to use this approach I can just keep it for my own use.