-
Notifications
You must be signed in to change notification settings - Fork 543
Fix Westmanga: change template #8177
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
Conversation
MikeZeDev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First : fix linting.
MikeZeDev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Must change some code
- I am wondering why bothering to update that for hakuneko
- if you have found errors in Haruneko support by all mean tell us. I see differences i cant explain.
|
|
||
| canHandleURI(uri) { | ||
| return new RegExp( | ||
| `^${this.url.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&")}/comic/[^/]+$`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove canHandleURI entirely. We dont use such precise control in hakuneko. Plus that regexp is way too complex .
| } = await this.fetchAPI(`./v/${chapter.id}`); | ||
|
|
||
| return images.map((img) => { | ||
| let url = typeof img === "string" ? img : img.url || img.source; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is that? is there something i missed in haruneko?
Can you provide sample url?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plus if img is a string how can it have an "url" property?
| return chapters.map(({ slug, number }) => { | ||
| let title = number.toString().trim(); | ||
| if (/^\d+(\.\d+)?$/.test(title)) { | ||
| title = `Chapter ${title}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefixing with chapter will lead to inconsistencies with haruneko and. .. can you explain what you are doing with the title?
| async getMangasFromPage(page) { | ||
| const { data } = await this.fetchAPI(`./contents?page=${page}`); | ||
| return data | ||
| ? data.map(({ slug, title }) => ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure that Hakuneko stable 6.1.7 is ok with the ? : syntax . Perhaps i am just too careful.
| super.label = "WestManga"; | ||
| this.tags = ["manga", "manhua", "manhwa", "indonesian"]; | ||
| this.url = "https://westmanga.me"; | ||
| this.queryMangaTitle = "h1"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why using a class property for that ?
| } | ||
|
|
||
| async _getPages(chapter) { | ||
| const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inline this
|
|
||
| async _getMangaFromURI(uri) { | ||
| const slug = uri.pathname.split("/").pop(); | ||
| const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inline this
Example URL:
https://westmanga.me/comic/maou-ni-natte-node
https://westmanga.me/view/maou-ni-natte-node-dungeon-tsukutte-jingai-musume-to-honobono-suru-chapter-83-1-bahasa-indonesia