aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/epub.rs8
-rw-r--r--src/main.rs3
2 files changed, 1 insertions, 10 deletions
diff --git a/src/epub.rs b/src/epub.rs
index 6f736de..d86fa35 100644
--- a/src/epub.rs
+++ b/src/epub.rs
@@ -33,14 +33,6 @@ pub async fn write_container_xml(dest_root: &Path, opf_full_path: &str) -> Resul
Ok(())
}
-/// Creates and writes the mimetype. Assumes dest_root already exists.
-pub async fn write_mimetype(dest_root: &Path) -> Result<()> {
- let dest_path = dest_root.join("mimetype");
- let mut file = File::create(dest_path).await?;
- file.write_all(b"application/epub+zip").await?;
- Ok(())
-}
-
pub async fn download_all_files(
client: &Client,
file_entries: &[FileEntry],
diff --git a/src/main.rs b/src/main.rs
index 6376315..db1fdd4 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, write_container_xml, write_mimetype};
+use crate::epub::{download_all_files, write_container_xml};
use crate::http_client::build_authenticated_client;
use crate::models::{Chapter, EpubResponse, FileEntry, Paginated, SpineItem, TocNode};
use anyhow::{Context, Result, ensure};
@@ -121,7 +121,6 @@ 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?;
write_container_xml(dest_root, &opf_entry.full_path).await?;
// Sanity check: Every entry in spine exists in chapters.