[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/calibre be94be6962 46/76: Add ability to filter by seri
|
From: |
ELPA Syncer |
|
Subject: |
[elpa] externals/calibre be94be6962 46/76: Add ability to filter by series and format |
|
Date: |
Thu, 18 May 2023 09:57:44 -0400 (EDT) |
branch: externals/calibre
commit be94be6962bc075230e3f950e7666f4f02cf5bb5
Author: Kjartan Óli Ágústsson <kjartanoli@disroot.org>
Commit: Kjartan Óli Ágústsson <kjartanoli@disroot.org>
Add ability to filter by series and format
* calibre-db.el (calibre-db--get-formats): Create
(calibre--get-filter-items): Assume value is already a string when
field is format.
* calibre-search.el (calibre-library-search-series,
calibre-library-search-format): Create
(calibre-search): Add bindings for calibre-library-search-series and
calibre-library-search-format.
It would be pointless to convert the result of
calibre-search-chose-format to a symbol, just to immediately convert
it back to a string.
---
calibre-db.el | 7 ++++++-
calibre-search.el | 8 +++++++-
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/calibre-db.el b/calibre-db.el
index bef7697574..313d6e18ff 100644
--- a/calibre-db.el
+++ b/calibre-db.el
@@ -107,6 +107,11 @@ WHERE books.id = ?"
(flatten-list (sqlite-select (calibre--db)
"SELECT name FROM publishers;")))
+(defun calibre-db--get-formats ()
+ "Return a list of the file formats stored in the active library."
+ (flatten-list (sqlite-select (calibre--db)
+ "SELECT DISTINCT format FROM data;")))
+
(defvar calibre--db nil)
(defun calibre--db ()
"Return the metadata database."
@@ -179,7 +184,7 @@ WHERE format = ?" `[,format])))
(tag (calibre-db--get-tag-books value))
(publisher (calibre-db--get-publisher-books value))
(series (calibre-db--get-series-books value))
- (format (calibre-db--get-format-books (upcase (symbol-name value)))))))
+ (format (calibre-db--get-format-books value)))))
(defun calibre-library--filter (filters books)
"Return those books in BOOKS that match FILTERS.
diff --git a/calibre-search.el b/calibre-search.el
index fad8824fa3..8e2fb187a1 100644
--- a/calibre-search.el
+++ b/calibre-search.el
@@ -48,6 +48,8 @@ will not be appended to the calibre-db--get-FIELD function's
name."
(calibre-search--choice-function "author" t)
(calibre-search--choice-function "publisher")
(calibre-search--choice-function "tag")
+(calibre-search--choice-function "series" nil t)
+(calibre-search--choice-function "format")
(defun calibre-search--operation (args)
"Return the appropriate symbol for a filter operation.
@@ -68,7 +70,9 @@ ARGS is the argument list of a transient command."
(calibre-library--search-function "author")
(calibre-library--search-function "publisher")
+(calibre-library--search-function "series")
(calibre-library--search-function "tag")
+(calibre-library--search-function "format")
(defun calibre-library-clear-last-search ()
"Clear the last applied search filter."
@@ -85,7 +89,9 @@ ARGS is the argument list of a transient command."
["Search"
("a" "Author" calibre-library-search-author)
("p" "Publisher" calibre-library-search-publisher)
- ("t" "Tag" calibre-library-search-tag)]
+ ("t" "Tag" calibre-library-search-tag)
+ ("s" "Series" calibre-library-search-series)
+ ("f" "Format" calibre-library-search-format)]
["Misc"
("u" "Undo" calibre-library-clear-last-search)
("c" "Clear" calibre-library-clear-filters)
- [elpa] externals/calibre d8682121d8 23/76: Reorder variable declarations, (continued)
- [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
- [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 <=
- [elpa] externals/calibre 89e52d61c0 50/76: Only allow single publisher per book, ELPA Syncer, 2023/05/18
- [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