[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/calibre 89e52d61c0 50/76: Only allow single publisher p
|
From: |
ELPA Syncer |
|
Subject: |
[elpa] externals/calibre 89e52d61c0 50/76: Only allow single publisher per book |
|
Date: |
Thu, 18 May 2023 09:57:45 -0400 (EDT) |
branch: externals/calibre
commit 89e52d61c07f759506f41ad843960c12e1e6723d
Author: Kjartan Óli Ágústsson <kjartanoli@disroot.org>
Commit: Kjartan Óli Ágústsson <kjartanoli@disroot.org>
Only allow single publisher per book
* calibre-book.el (calibre-book): Replace publisher slot with publisher.
(calibre-book-publishers, calibre-book-publisher): Rename
calibre-book-publishers to calibre-book-publisher.
* calibre-db.el (calibre-make-book, calibre-library-columns,
calibre-library--header-format, calibre-book--print-info): Adjust to
the singular publisher field.
(calibre-db--get-book-publishers): Remove
(calibre-db--get-book-publisher): Add
---
calibre-book.el | 9 +++++----
calibre-db.el | 22 +++++++++++-----------
2 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/calibre-book.el b/calibre-book.el
index 801c78f86e..991e599b7c 100644
--- a/calibre-book.el
+++ b/calibre-book.el
@@ -43,9 +43,10 @@ TIMESTAMP is a string of the form YYYY-MM-DD
HH:MM:SS.xxxxxx+00:00."
(authors :initarg :authors
:type list
:documentation "The authors of the book.")
- (publishers :initarg :publishers
- :type list
- :documentation "The publishers of the book.")
+ (publisher :initarg :publisher
+ :type (or string null)
+ :documentation "The publisher of the book."
+ :custom (choice (const nil) string))
(series :initarg :series
:initform nil
:type (or string null)
@@ -84,7 +85,7 @@ for private functions."
(calibre-book--slot id)
(calibre-book--slot title)
(calibre-book--slot authors)
-(calibre-book--slot publishers)
+(calibre-book--slot publisher)
(calibre-book--slot series)
(calibre-book--slot series-index)
(calibre-book--slot tags)
diff --git a/calibre-db.el b/calibre-db.el
index 55a25301fa..ddc3b71222 100644
--- a/calibre-db.el
+++ b/calibre-db.el
@@ -35,7 +35,7 @@ ENTRY is a list of the form:
(calibre-book :id id
:title title
:authors (calibre-db--get-book-authors id)
- :publishers (calibre-db--get-book-publishers id)
+ :publisher (calibre-db--get-book-publisher id)
:series series
:series-index series-index
:timestamp (calibre-parse-timestamp timestamp)
@@ -54,13 +54,13 @@ FROM authors
INNER JOIN books_authors_link al ON authors.id = al.author
WHERE al.book = ?" `[,id])))
-(defun calibre-db--get-book-publishers (id)
- "Return a list of publishers for the book identified by ID."
- (flatten-list (sqlite-select (calibre--db)
+(defun calibre-db--get-book-publisher (id)
+ "Return the publisher of the book identified by ID."
+ (car (flatten-list (sqlite-select (calibre--db)
"SELECT publishers.name
FROM publishers
INNER JOIN books_publishers_link pl ON publishers.id = pl.publisher
-WHERE pl.book = ?" `[,id])))
+WHERE pl.book = ?" `[,id]))))
(defun calibre-db--get-book-file-name (id)
"Return the file name, sans extension, of the book identified by ID."
@@ -297,7 +297,7 @@ string."
(defcustom calibre-library-columns '((id . 4)
(title . 35)
(authors . 20)
- (publishers . 10)
+ (publisher . 10)
(series . 15)
(series-index . 3)
(tags . 10)
@@ -312,7 +312,7 @@ column should have."
(const :tag "ID" id)
(const :tag "Title" title)
(const :tag "Author(s)" authors)
- (const :tag "Publisher(s)" publishers)
+ (const :tag "Publisher(s)" publisher)
(const :tag "Series" series)
(const :tag "Series Index" series-index)
(const :tag "Tags" tags)
@@ -323,7 +323,7 @@ column should have."
(set-default symbol value)
(calibre-library--set-header)
(calibre-library--refresh))
- :package-version '("calibre" . "0.1.0")
+ :package-version '("calibre" . "1.1.0")
:group 'calibre)
(defun calibre-library--header-format ()
@@ -341,7 +341,7 @@ with values determined by `calibre-library-columns'."
:right-align t))
(title `("Title" ,width t))
(authors `("Author(s)" ,width t))
- (publishers `("Publisher(s)" ,width t))
+ (publisher `("Publisher" ,width t))
(series `("Series" ,width (lambda (a b)
(calibre-book-sort-by-series (car
a) (car b)))))
(series-index `("#" ,width (lambda (a b)
@@ -358,14 +358,14 @@ with values determined by `calibre-library-columns'."
"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 pubdate) book
+ (with-slots (id title authors publisher series series-index tags
formats pubdate) book
(vconcat (mapcar (lambda (x)
(let ((column (car x)))
(cl-case column
(id (int-to-string id))
(title title)
(authors (string-join authors ", "))
- (publishers (string-join publishers ", "))
+ (publisher (if (not publisher) "" publisher))
(series (if (not series) "" series))
(series-index (if series (format "%.1f"
series-index) ""))
(tags (string-join tags ", "))
- [elpa] externals/calibre a750735b89 33/76: Add ability to revert Library buffer, (continued)
- [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
- [elpa] externals/calibre 8ae08bd7fb 68/76: Update README, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 5e81e98079 18/76: Add README, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre bdb11248c9 20/76: Move metadata into calibre.el, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 1c0bf191d5 35/76: Refresh Library buffer when calibre-library-columns is changed, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre c644d0761d 40/76: Slight improvement to README, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre be94be6962 46/76: Add ability to filter by series and format, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 89e52d61c0 50/76: Only allow single publisher per book,
ELPA Syncer <=
- [elpa] externals/calibre c6a5772da0 29/76: Fix docstring, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 7396636341 30/76: Only refresh Library buffer if it exists, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 6d7ed97ab6 31/76: Use the value of calibre-calibredb-executable, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 4a0d5b9606 32/76: Factor the setting of the Library header into a function, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 85e3ac6337 48/76: Add missing space in completing-read prompt, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 6366966c9b 60/76: Add abstraction layer on top of calibre-db, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 9a54c7a6b4 09/76: Add function to add books from dired, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 533c68f55f 27/76: Do right alignment correctly, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 3e6ce3abc2 39/76: Bump package version, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 569c096746 45/76: Use macros to avoid repeating similar function definitions, ELPA Syncer, 2023/05/18