From 78bf4e55539627477613e61bba27db6da7b770ac Mon Sep 17 00:00:00 2001 From: Lorenzo Di Fuccia Date: Wed, 13 Dec 2017 15:07:33 +0100 Subject: [PATCH] EPUB Metadata improvement: add release date --- safaribooks.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/safaribooks.py b/safaribooks.py index 6a7a577..5dc1f79 100644 --- a/safaribooks.py +++ b/safaribooks.py @@ -110,9 +110,10 @@ class Display: ("Publishers", ", ".join(pub["name"] for pub in info["publishers"])), ("Rights", info["rights"]), ("Description", description[:500] + "..." if len(description) >= 500 else description), + ("Release Date", info["issued"]), ("URL", info["web_url"]) ]: - self.info("{0}: {1}".format(t[0], t[1]), True) + self.info("{0}{1}{2}: {3}".format(self.SH_YELLOW, t[0], self.SH_DEFAULT, t[1]), True) def state(self, origin, done): progress = int(done * 100 / origin) @@ -196,7 +197,7 @@ class SafariBooks: "" \ "" - # Format: ID, Title, Authors, Description, Subjects, Publisher, Rights, CoverId, MANIFEST, SPINE, CoverUrl + # Format: ID, Title, Authors, Description, Subjects, Publisher, Rights, Date, CoverId, MANIFEST, SPINE, CoverUrl CONTENT_OPF = "\n" \ "\n" \ "{5}\n" \ "{6}\n" \ "en-US\n" \ + "{7}" \ "{0}\n" \ - "\n" \ + "\n" \ "\n" \ "\n" \ "\n" \ - "{8}\n" \ + "{9}\n" \ "\n" \ - "\n{9}\n" \ - "\n" \ + "\n{10}\n" \ + "\n" \ "" # Format: ID, Depth, Title, Author, NAVMAP @@ -704,6 +706,7 @@ class SafariBooks: subjects, ", ".join(escape(pub["name"]) for pub in self.book_info["publishers"]), escape(self.book_info["rights"]), + self.book_info["issued"], self.cover if self.cover else alt_cover_id, "\n".join(manifest), "\n".join(spine),