Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sources/multi.webtoon/res/source.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"info": {
"id": "multi.webtoon",
"name": "WEBTOON",
"version": 4,
"version": 5,
"urls": [
"https://www.webtoons.com",
"https://m.webtoons.com"
Expand Down
11 changes: 8 additions & 3 deletions sources/multi.webtoon/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ pub fn parse_manga_listing(listing: Listing, page: i32) -> Result<MangaPageResul
page,
),
"canvas_popular" => parse_canvas_list(
&format!("{base_url}/canvas/list?genreTab=ALL&sortOrder=READ_COUNT"),
&format!("{base_url}/canvas/list?genreTab=ALL&sortOrder=MANA"),
page,
),
"canvas_top" => parse_canvas_list(
Expand Down Expand Up @@ -224,7 +224,12 @@ pub fn parse_canvas_list(url: &str, page: i32) -> Result<MangaPageResult> {
if !seen.insert(id.clone()) {
continue;
}
let cover = node.select_first("img").and_then(|img| img.attr("src"));
let cover = node
.select_first("img")
.and_then(|img| img.attr("src"))
.unwrap_or_default()
.replace("?type=f164_164", "");
Comment on lines +230 to +231

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.

I think this should just be a map so it doesn't use empty strings instead of None to be more technically correct, but this shouldn't have any practical difference while we expect the image sources to exist.


let title = node
.select_first(".subj")
.and_then(|t| t.text())
Expand All @@ -238,7 +243,7 @@ pub fn parse_canvas_list(url: &str, page: i32) -> Result<MangaPageResult> {
entries.push(Manga {
key: id,
title,
cover,
cover: Some(cover),
url: Some(full_url),
viewer: Viewer::Webtoon,
content_rating: ContentRating::Safe,
Expand Down
Loading