Skip to content

Commit

Permalink
fixed : serde_json error on chapter download
Browse files Browse the repository at this point in the history
  • Loading branch information
tonymushah committed Oct 9, 2023
1 parent 7b257d4 commit e40049c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mangadex-desktop-api2"
version = "0.5.7-alpha.1"
version = "0.5.7-alpha.2"
authors = ["tonymushah <tonymushahdev06@yahoo.com>"]
license = "MIT OR Apache-2.0"
description = "A Actix server for downloading manga, chapters, covers from Mangadex"
Expand Down
3 changes: 3 additions & 0 deletions src/download/chapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ impl ChapterDownload {
.dirs_options
.chapters_add(format!("{}/data.json", id).as_str());
let http_client = self.http_client.lock().await.client.clone();
log::info!("{path}");
task_manager.lock_spawn_with_data(async move {
let get_chapter = http_client
.get(
Expand All @@ -68,7 +69,9 @@ impl ChapterDownload {
let chapter_data = File::create((path).as_str())?;
let mut writer = BufWriter::new(chapter_data.try_clone()?);
writer.write_all(&bytes_)?;
log::info!("writed data");
writer.flush()?;
let chapter_data = File::open((path).as_str())?;
Ok(serde_json::from_reader(BufReader::new(chapter_data))?)
}).await?
}
Expand Down

0 comments on commit e40049c

Please sign in to comment.