[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/calibre 2b64cb76ad 49/76: Add support for displaying pu
From: |
ELPA Syncer |
Subject: |
[elpa] externals/calibre 2b64cb76ad 49/76: Add support for displaying publication date |
Date: |
Thu, 18 May 2023 09:57:45 -0400 (EDT) |
branch: externals/calibre
commit 2b64cb76ad8d1e8de227c71bb01dd091eeab3b21
Author: Kjartan Óli Ágústsson <kjartanoli@disroot.org>
Commit: Kjartan Óli Ágústsson <kjartanoli@disroot.org>
Add support for displaying publication date
* calibre-book.el (calibre-book-pubdate): Add a getter for a book's
publication date.
* calibre-db.el (calibre-library-time-format): Add a new defcustom to
control the format of time related metadata fields.
(calibre-library-columns): Add a new column option to display
publication date.
(calibre-library--header-format, calibre-book--print-info): Handle the
new option of displaying publication date.
---
calibre-book.el | 1 +
calibre-db.el | 24 ++++++++++++++++++++----
2 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/calibre-book.el b/calibre-book.el
index b3a4edaa44..801c78f86e 100644
--- a/calibre-book.el
+++ b/calibre-book.el
@@ -91,6 +91,7 @@ for private functions."
(calibre-book--slot formats)
(calibre-book--slot path t)
(calibre-book--slot file-name)
+(calibre-book--slot pubdate)
(defcustom calibre-format-preferences '(pdf epub)
"The preference order of file formats."
diff --git a/calibre-db.el b/calibre-db.el
index 3f6c42bdb1..55a25301fa 100644
--- a/calibre-db.el
+++ b/calibre-db.el
@@ -283,6 +283,17 @@ If FORCE is non-nil fetch book data from the database."
(setf tabulated-list-format (calibre-library--header-format))
(tabulated-list-init-header)))))
+(defcustom calibre-library-time-format "%x"
+ "String specifying format for displaying time related metadata.
+See `format-time-string' for an explanation of how to write this
+string."
+ :type 'string
+ :set (lambda (symbol value)
+ (set-default symbol value)
+ (calibre-library--refresh))
+ :group 'calibre
+ :package-version '("calibre" . "1.1.0"))
+
(defcustom calibre-library-columns '((id . 4)
(title . 35)
(authors . 20)
@@ -305,7 +316,8 @@ column should have."
(const :tag "Series" series)
(const :tag "Series Index" series-index)
(const :tag "Tags" tags)
- (const :tag "Formats" formats))
+ (const :tag "Formats" formats)
+ (const :tag "Publication date" pubdate))
(integer :tag "Width")))
:set (lambda (symbol value)
(set-default symbol value)
@@ -336,14 +348,17 @@ with values determined by `calibre-library-columns'."
(calibre-book-sort-by-series
(car a) (car b)))
:right-align t))
(tags `("Tags" ,width))
- (formats `("Formats" ,width)))))
+ (formats `("Formats" ,width))
+ (pubdate `("Publication Date" ,width (lambda (a b)
+ (time-less-p
(calibre-book-pubdate (car a))
+
(calibre-book-pubdate (car b)))))))))
calibre-library-columns)))
(defun calibre-book--print-info (book)
"Return list suitable as a value of `tabulated-list-entries'.
BOOK is a `calibre-book'."
(list book
- (with-slots (id title authors publishers series series-index tags
formats) book
+ (with-slots (id title authors publishers series series-index tags
formats pubdate) book
(vconcat (mapcar (lambda (x)
(let ((column (car x)))
(cl-case column
@@ -354,7 +369,8 @@ BOOK is a `calibre-book'."
(series (if (not series) "" series))
(series-index (if series (format "%.1f"
series-index) ""))
(tags (string-join tags ", "))
- (formats (string-join (mapcar (lambda (f)
(upcase (symbol-name f))) formats) ", ")))))
+ (formats (string-join (mapcar (lambda (f)
(upcase (symbol-name f))) formats) ", "))
+ (pubdate (format-time-string
calibre-library-time-format pubdate)))))
calibre-library-columns)))))
(defun calibre-book--file (book format)
- [elpa] externals/calibre ecf03e1842 19/76: Fix circular dependencies and byte compiler warnings, (continued)
- [elpa] externals/calibre ecf03e1842 19/76: Fix circular dependencies and byte compiler warnings, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre e2863a9d6a 21/76: Fix byte compiler warning, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 330471a75f 26/76: Fix circular dependency and byte compiler warnings, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre fd1b0e5fd7 28/76: Use message instead of display-warning, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre bc26df0b48 36/76: Set tabulated-list-format in the correct buffer, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 07df132f5d 53/76: Error if no libraries are defined, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre b7d6dd90f1 57/76: Add customisation types to book slots, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 4e4bf841cb 59/76: Rename calibre-make-book, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 832e91827d 63/76: Move calibre--library to calibre-util, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre b43ab3a90c 73/76: Allow overriding format preferences, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 2b64cb76ad 49/76: Add support for displaying publication date,
ELPA Syncer <=
- [elpa] externals/calibre ca0ae8a1d3 74/76: Pick some format if no preferred format is available, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre c6cb36b0a3 17/76: Fix byte-compiler warnings, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 8c791fb915 05/76: Add missing sort by series function, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 360fbf15cb 02/76: Fix defcustom version strings, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 76427bf5be 07/76: Allow customisation of the columns of the library buffer, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre d8682121d8 23/76: Reorder variable declarations, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre a750735b89 33/76: Add ability to revert Library buffer, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre b2c34a58d4 44/76: Use the right column name in query, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 7a8ed52e86 51/76: Set revert-buffer-function instead of using revert hooks, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 521fc7471b 66/76: Add faces to make library buffer easier to parse, ELPA Syncer, 2023/05/18