From 3d54b73266646f73e855a175dbfd86ca2d50ba96 Mon Sep 17 00:00:00 2001 From: A Farzat Date: Wed, 4 Nov 2026 15:25:31 +0300 Subject: Record the O'Reilly bookid in the generated EPUB Store the O'Reilly bookid as EPUB metadata instead of relying solely on the filename. Preserving the original bookid makes it possible to look up additional information from the upstream O'Reilly resource later, even if the EPUB is renamed or imported into a library manager. --- src/epub.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/epub.rs') diff --git a/src/epub.rs b/src/epub.rs index 1336115..96b1f2c 100644 --- a/src/epub.rs +++ b/src/epub.rs @@ -96,6 +96,7 @@ pub async fn download_one_file( /// Creates the EPUB archive (creates zip and includes all files in it). pub fn create_epub_archive( + bookid: &str, epub_data: &EpubResponse, epub_root: &Path, output_epub: &Path, @@ -154,7 +155,7 @@ pub fn create_epub_archive( &mut zip, )?; } else if entry.ourn == opf_entry.ourn { - write_modified_opf(buf_reader, &mut zip, &epub_data.descriptions.plain)?; + write_modified_opf(buf_reader, &mut zip, bookid, &epub_data.descriptions.plain)?; } else { std::io::copy(&mut buf_reader, &mut zip)?; } -- cgit v1.3.1