[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/calibre 38e0beb840 03/76: Get publishers
|
From: |
ELPA Syncer |
|
Subject: |
[elpa] externals/calibre 38e0beb840 03/76: Get publishers |
|
Date: |
Thu, 18 May 2023 09:57:40 -0400 (EDT) |
branch: externals/calibre
commit 38e0beb8400bd2260016744529751934e36df8f0
Author: Kjartan Óli Ágústsson <kjartanoli@disroot.org>
Commit: Kjartan Óli Ágústsson <kjartanoli@disroot.org>
Get publishers
* calibre-book.el (calibre-book): Added the publishers slot
(calibre-make-book): Added initialisation of the publishers slot
* calibre-db.el: Created new function calibre-db--get-publishers
---
calibre-book.el | 5 +++++
calibre-db.el | 8 ++++++++
2 files changed, 13 insertions(+)
diff --git a/calibre-book.el b/calibre-book.el
index d5bc409e6f..c3bfecd44d 100644
--- a/calibre-book.el
+++ b/calibre-book.el
@@ -37,6 +37,9 @@
(authors :initarg :authors
:type list
:documentation "The authors of the book.")
+ (publishers :initarg :publishers
+ :type list
+ :documentation "The publishers of the book.")
(series :initarg :series
:initform nil
:type (or string null)
@@ -75,6 +78,7 @@ for private functions."
(calibre-book--slot id)
(calibre-book--slot title)
(calibre-book--slot authors)
+(calibre-book--slot publishers)
(calibre-book--slot series)
(calibre-book--slot series-index)
(calibre-book--slot tags)
@@ -90,6 +94,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)
:series series
:series-index series-index
:timestamp (calibre-parse-timestamp timestamp)
diff --git a/calibre-db.el b/calibre-db.el
index 3bad18fa40..25df7a9f78 100644
--- a/calibre-db.el
+++ b/calibre-db.el
@@ -48,6 +48,14 @@ 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)
+ "SELECT publishers.name
+FROM publishers
+INNER JOIN books_publishers_link pl ON publishers.id = pl.publisher
+WHERE pl.book = ?" `[,id])))
+
(defun calibre-db--get-book-file-name (id)
"Return the file name, sans extension, of the book identified by ID."
(car (car (sqlite-select (calibre--db)
- [elpa] externals/calibre ac4c02aeb9 47/76: Add support for composite filters, (continued)
- [elpa] externals/calibre ac4c02aeb9 47/76: Add support for composite filters, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 187685e08e 70/76: Use cond instead of cl-case, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 0e7221461b 62/76: Add ability to use CLI interface instead of SQLite, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 13141efce4 67/76: Bump package version, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 3a7abbee56 64/76: Use compat to lower required Emacs version, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 090b28d6ec 69/76: Use int-to-string instead of format, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre fd949f1813 72/76: Set name of calibre-library-mode, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 8560bbd48b 75/76: Sort in ascending order by series index, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre dc4b5f79ac 11/76: Add commentary, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 7d97c360f1 15/76: Update package version to 1.0, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 38e0beb840 03/76: Get publishers,
ELPA Syncer <=
- [elpa] externals/calibre 188a3da504 04/76: Add functions to add and remove books, ELPA Syncer, 2023/05/18
- [elpa] externals/calibre 393ae4a945 12/76: Add force option to library refresh, ELPA Syncer, 2023/05/18
- [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