emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/calibre f0324a9d21 06/10: Move calibre-parse-timestamp


From: ELPA Syncer
Subject: [elpa] externals/calibre f0324a9d21 06/10: Move calibre-parse-timestamp to calibre-db
Date: Thu, 18 May 2023 12:57:32 -0400 (EDT)

branch: externals/calibre
commit f0324a9d21cd512bba26f06d73b367581e14e26c
Author: Kjartan Óli Ágústsson <kjartanoli@disroot.org>
Commit: Kjartan Óli Ágústsson <kjartanoli@disroot.org>

    Move calibre-parse-timestamp to calibre-db
    
    * calibre-book.el (calibre-parse-timestamp): Rename to 
calibredb--parse-timestamp.
    * calibre-db.el (calibre-db--parse-timestamp): Rename from 
calibre-parse-timestamp.
    (calibre-db--make-book): Call calibre-db--parse-timestamp.
---
 calibre-book.el |  4 ----
 calibre-db.el   | 11 ++++++++---
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/calibre-book.el b/calibre-book.el
index 4746e6890a..c83885fbba 100644
--- a/calibre-book.el
+++ b/calibre-book.el
@@ -28,10 +28,6 @@
 (require 'eieio)
 (require 'parse-time)
 
-(defun calibre-parse-timestamp (timestamp)
-  "Return a Lisp timestamp from TIMESTAMP.
-TIMESTAMP is a string of the form YYYY-MM-DD HH:MM:SS.xxxxxx+00:00."
-  (parse-iso8601-time-string (string-replace " " "T" timestamp)))
 
 (defclass calibre-book ()
   ((id :initarg :id
diff --git a/calibre-db.el b/calibre-db.el
index 26ba2d1809..d5b76c720d 100644
--- a/calibre-db.el
+++ b/calibre-db.el
@@ -28,6 +28,11 @@
 (require 'calibre-book)
 (require 'calibre-util)
 
+(defun calibre-db--parse-timestamp (timestamp)
+  "Return a Lisp timestamp from TIMESTAMP.
+TIMESTAMP is a string of the form YYYY-MM-DD HH:MM:SS.xxxxxx+00:00."
+  (parse-iso8601-time-string (string-replace " " "T" timestamp)))
+
 (defun calibre-db--make-book (entry)
   "Create a `calibre-book' from ENTRY.
 ENTRY is a list of the form:
@@ -39,13 +44,13 @@ ENTRY is a list of the form:
                   :publisher (calibre-db--get-book-publisher id)
                   :series series
                   :series-index series-index
-                  :timestamp (calibre-parse-timestamp timestamp)
-                  :pubdate (calibre-parse-timestamp pubdate)
-                  :last-modified (calibre-parse-timestamp last-modified)
                   :tags (calibre-db--get-book-tags id)
                   :formats (calibre-db--get-book-formats id)
                   :path path
                   :file-name (calibre-db--get-book-file-name id))))
+                       :timestamp (calibre-db--parse-timestamp timestamp)
+                       :pubdate (calibre-db--parse-timestamp pubdate)
+                       :last-modified (calibre-db--parse-timestamp 
last-modified)
 
 (defun calibre-db--get-book-authors (id)
   "Return a list of authors for the book identified by ID."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]