Skip to content

Commit

Permalink
Fix percent being able to resolve to NaN
Browse files Browse the repository at this point in the history
  • Loading branch information
PhantomShift committed Apr 12, 2024
1 parent d9a7ce5 commit 4776f4e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,11 @@ fn neko_to_kotatsu(input_path: String, output_path: PathBuf, verbose: bool) -> s
scroll: 0,
image_url: kotatsu_manga.cover_url.clone(),
created_at: 0,
percent: chapter.last_page_read as f32 / (chapter.last_page_read as f32 + chapter.pages_left as f32),
percent: if chapter.last_page_read + chapter.pages_left == 0 {
0.0
} else {
chapter.last_page_read as f32 / (chapter.last_page_read as f32 + chapter.pages_left as f32)
},
})
}).collect::<Vec<_>>();
if bookmarks.len() > 0 {
Expand Down

0 comments on commit 4776f4e

Please sign in to comment.