aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorA Farzat <a@farzat.xyz>2026-03-03 11:10:03 +0300
committerA Farzat <a@farzat.xyz>2026-03-03 11:22:00 +0300
commit6aad662ec59a3974cbca6c423c1e08e8bc5e90f6 (patch)
treeeb97ccab865cec7ac530a4c0d2d63f9dfd4c3867 /src/main.rs
parentb0035a511b13b03c4c73b0cfad488dbab541e01e (diff)
downloadoreilly-epub-6aad662ec59a3974cbca6c423c1e08e8bc5e90f6.tar.gz
oreilly-epub-6aad662ec59a3974cbca6c423c1e08e8bc5e90f6.zip
Add a function to write mimetype
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index ed73ec7..6e9e6dd 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -5,7 +5,7 @@ mod models;
use std::collections::HashMap;
use std::path::Path;
-use crate::epub::download_all_files;
+use crate::epub::{download_all_files, write_mimetype};
use crate::http_client::build_authenticated_client;
use crate::models::{Chapter, EpubResponse, FileEntry, Paginated, SpineItem, TocNode};
use anyhow::{Context, Result, ensure};
@@ -121,6 +121,7 @@ async fn main() -> Result<()> {
let dest_root = format!("Books/{}/epub_root", args.bookid);
let dest_root = Path::new(&dest_root);
download_all_files(&client, &file_entries, dest_root).await?;
+ write_mimetype(dest_root).await?;
// Sanity check: Every entry in spine exists in chapters.
let chapters: HashMap<String, Chapter> =