aboutsummaryrefslogtreecommitdiff
path: root/src/epub.rs
diff options
context:
space:
mode:
authorA Farzat <a@farzat.xyz>2026-03-08 16:17:23 +0300
committerA Farzat <a@farzat.xyz>2026-03-08 16:17:23 +0300
commit506be822134c51300ab589256ad66a7e7eac3ae1 (patch)
tree3088523fd8cd5004f6bcdd1d0a4b31039fff030e /src/epub.rs
parentb6a88532c1b8d8f011f0f80809d69e13e4057df6 (diff)
downloadoreilly-epub-506be822134c51300ab589256ad66a7e7eac3ae1.tar.gz
oreilly-epub-506be822134c51300ab589256ad66a7e7eac3ae1.zip
Add EPUB descriptions to OPF files
Diffstat (limited to 'src/epub.rs')
-rw-r--r--src/epub.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/epub.rs b/src/epub.rs
index 4f31784..62e7c8d 100644
--- a/src/epub.rs
+++ b/src/epub.rs
@@ -1,6 +1,6 @@
use crate::{
models::{Chapter, EpubResponse, FileEntry},
- xml::build_epub_chapter,
+ xml::{build_epub_chapter, write_modified_opf},
};
use anyhow::{Context, Result};
use ogrim::xml;
@@ -122,6 +122,8 @@ pub fn create_epub_archive(
&url_path_to_local,
&mut zip,
)?;
+ } else if entry.ourn == opf_entry.ourn {
+ write_modified_opf(buf_reader, &mut zip, &epub_data.descriptions.plain)?;
} else {
copy(&mut buf_reader, &mut zip)?;
}