Skip to content

feat: add zaimanhua template - #842

Merged
kkantan merged 1 commit into
Aidoku-Community:mainfrom
Aiko3993:dev/sources
Oct 29, 2026
Merged

kkantan merged 1 commit into
Aidoku-Community:mainfrom
Aiko3993:dev/sources

Conversation

@Aiko3993

@Aiko3993 Aiko3993 commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor
  • extract a shared template for comics and light novels
  • add zh.zaimanhuanovel for the site's light novels
  • parse chapter and volume numbers from comic titles
  • add an optional end-of-chapter comments page for comics
  • align behavior with the official app
  • remove obsolete proxy settings

@Aiko3993
Aiko3993 force-pushed the dev/sources branch 5 times, most recently from 5b4ee96 to bd4742e Compare October 27, 2026 09:43
Comment thread sources/zh.zaimanhua/src/models.rs Outdated
.collect();
let page_size = entries.len() as i32;
MangaPageResult {
has_next_page: page_size > 0 && self.total > page * page_size,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is page_size reliable here? I imagine that the final page has less than the usual number of entries for a page size, so it will always fetch another page despite one not existing. does the api data provide a consistent page size?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is page_size reliable here? I imagine that the final page has less than the usual number of entries for a page size, so it will always fetch another page despite one not existing. does the api data provide a consistent page size?

I re-checked the requests and noticed that the mobile site always seems to pass a fixed size of 20, so I updated it to use that.

Comment thread sources/zh.zaimanhua/res/settings.json Outdated
"type": "switch",
"key": "chapterComments",
"title": "章末吐槽",
"requiresFalse": "contentType == novel"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this work? I didn't know you could do this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this work? I didn't know you could do this.

do you mean requiresFalse: "contentType == novel"?
I confirmed it works, though on Aidoku versions below 0.9 it doesn't disable the toggle... also, the site seems accessible outside mainland China now if you'd like to take a look.

@dyphire

dyphire commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

After selecting one type, the other type's content will become unavailable. You'll need to provide a mixed category to browse and search all types of content.

@Aiko3993

Aiko3993 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor Author

After selecting one type, the other type's content will become unavailable. You'll need to provide a mixed category to browse and search all types of content.

I’m not really sure how to do this cleanly, since the comic and novel APIs are separate, and they don't completely mirror each other. I was especially unsure how to handle the filters in a Mixed type.
I also noticed the official app keeps them separate as well, so I decided to keep it this way.
if you have a better idea, a PR after this merges would be great I think.

@dyphire

dyphire commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

After selecting one type, the other type's content will become unavailable. You'll need to provide a mixed category to browse and search all types of content.

I’m not really sure how to do this cleanly, since the comic and novel APIs are separate, and they don't completely mirror each other. I was especially unsure how to handle the filters in a Mixed type. I also noticed the official app keeps them separate as well, so I decided to keep it this way. if you have a better idea, a PR after this merges would be great I think.

Then I think it's better to submit fiction content as a separate source e.g. zh.zainovel (再小说) rather than providing content in the same source-switching results in users having to choose between two types of content to discard the other. Just like zh.bilimanga and zh.bilinovel already in this repository.

@kkantan kkantan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as dyphire is saying, I do believe that separating this into two different sources, using a template, may be better for users. that, or making the novel content type a search filter instead of a source setting, so that switching between the content types is easier.

Comment thread sources/zh.zaimanhua/src/models.rs Outdated
Comment thread sources/zh.zaimanhua/src/models.rs
Comment thread sources/zh.zaimanhua/src/models.rs Outdated
pub authors: Option<String>,
pub struct ChapterPages {
#[serde(default)]
pub page_url: Vec<String>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there was a page_url_hd field before that was preferred over page_url if it existed. is that gone now?

@Aiko3993 Aiko3993 Oct 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there was a page_url_hd field before that was preferred over page_url if it existed. is that gone now?

there didn't seem to be any difference between the two. if differences show up later, I'll bring it back.
forgot that both can coexist, so I'll bring page_url_hd back and fall back to page_url.

- extract a shared template for comics and light novels
- add zh.zaimanhuanovel for the site's light novels
- parse chapter and volume numbers from comic titles
- add an optional end-of-chapter comments page for comics
- align behavior with the official app
- remove obsolete proxy settings
@Aiko3993

Copy link
Copy Markdown
Contributor Author

I let a coding agent handle extracting the shared template, and it seems better than I expected... (?)

as for the naming, Zaimanhua is the site's main platform name, and the novels are just part of it, so naming it 再漫画轻小说 (zh.zaimanhuanovel) felt the most appropriate, even if it looks a bit lengthy (¿)
if there is a better naming convention, feel free to change it.

@Aiko3993 Aiko3993 changed the title feat(zh.zaimanhua): add novels and improve source feat: add zaimanhua template Oct 29, 2026

@kkantan kkantan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks fine to me, but the site doesn't appear to load for me outside of china so I can't test it.

@kkantan
kkantan merged commit f3a3f20 into Aidoku-Community:main Oct 29, 2026
3 checks passed
@Aiko3993

Copy link
Copy Markdown
Contributor Author

this looks fine to me, but the site doesn't appear to load for me outside of china so I can't test it.

that's weird, testing on globalping.io shows it seems to be accessible. I also accessed the source using a proxy set up on a US VPS.
Plus, a temporary remote machine I randomly found online (located in Africa) can access the website zaimanhua.com just fine (?)

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants