Skip to content

Commit

Permalink
fix(asura): broken chapter image indices (#783)
Browse files Browse the repository at this point in the history
* Filter out non ascii digits from parsed file name

* Bump version
  • Loading branch information
KaBankz authored Oct 20, 2024
1 parent e585608 commit 38ee875
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/rust/en.asurascans/res/source.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"id": "en.asurascans",
"lang": "en",
"name": "Asura Scans",
"version": 3,
"version": 4,
"url": "https://asuracomic.net",
"nsfw": 0
}
Expand Down
8 changes: 7 additions & 1 deletion src/rust/en.asurascans/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,13 @@ fn get_page_list(manga_id: String, chapter_id: String) -> Result<Vec<Page>> {
let index = {
let before = url.substring_after_last('/').unwrap_or("");
let after = before.substring_before('.').unwrap_or("");
after.parse::<i32>().unwrap_or(-1)

let cleaned_after = after
.chars()
.filter(|c| c.is_ascii_digit())
.collect::<String>();

cleaned_after.parse::<i32>().unwrap_or(-1)
};

pages.push(Page {
Expand Down

0 comments on commit 38ee875

Please sign in to comment.