From 121d3b0ac2eb1d08280b2acb5b39f797cbda62a7 Mon Sep 17 00:00:00 2001 From: njdelapaz <40581668+njdelapaz@users.noreply.github.com> Date: Tue, 10 Mar 2026 20:45:04 -0400 Subject: [PATCH] Add new script and button to update the metadata date (this is useful for Apple Books app users, as an edited file is the only way to open duplicates within the app. Without edits, duplicates are forcefully deleted) --- Epub.js | 8 ++++++++ index.html | 6 +++++- main.js | 8 ++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Epub.js b/Epub.js index 3636687..96223f8 100644 --- a/Epub.js +++ b/Epub.js @@ -738,6 +738,14 @@ class Epub { return sequence; } + updateDate(dateString) { + let dateEl = this.opf.dom.querySelector("dc\\:date:not([opf\\:event])"); + if (dateEl !== null) { + dateEl.textContent = dateString; + } + return Promise.resolve(this.replaceZipObject(this.opf.zipObjectName, this.opf.dom, true)); + } + checkForInvalidXhtml() { let sequence = Promise.resolve(); let bad = []; diff --git a/index.html b/index.html index baf8c29..3f85f80 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,4 @@ - +
@@ -98,6 +98,10 @@