branch: externals/calibre
commit ca0ae8a1d31a73bd78e028b21d55433dfdfc84c2
Author: Kjartan Óli Ágústsson <[email protected]>
Commit: Kjartan Óli Ágústsson <[email protected]>
Pick some format if no preferred format is available
* calibre-book.el (calibre-book--pick-format): Pick some available
format, if none of the user's preferred formats are available.
---
calibre-book.el | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/calibre-book.el b/calibre-book.el
index 6e3427a856..dea62879bf 100644
--- a/calibre-book.el
+++ b/calibre-book.el
@@ -107,8 +107,9 @@ for private functions."
(defun calibre-book--pick-format (book)
"Return the preferred format for BOOK."
- (car (seq-intersection calibre-format-preferences
- (calibre-book-formats book))))
+ (let ((pref (seq-intersection calibre-format-preferences
+ (calibre-book-formats book))))
+ (car (if pref pref (calibre-book-formats book)))))
(defun calibre-book-sort-by-series (a b)
"Return t if A should appear before B when sorting by series."