branch: externals/calibre
commit 9a54c7a6b4db61c884fd1f654ca8ffdee2aba1b1
Author: Kjartan Óli Ágústsson <[email protected]>
Commit: Kjartan Óli Ágústsson <[email protected]>

    Add function to add books from dired
    
    * calibre-library.el (calibre-dired-add): Created
---
 calibre-library.el | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/calibre-library.el b/calibre-library.el
index 9b057e2d34..4fbd2ab38a 100644
--- a/calibre-library.el
+++ b/calibre-library.el
@@ -43,6 +43,13 @@
   "Add FILES to the Calibre library."
   (calibre-library--execute `("add" ,@(mapcar #'expand-file-name files))))
 
+;;;###autoload
+(defun calibre-dired-add ()
+  "Add marked files to the Calibre library."
+    (interactive)
+    (if (derived-mode-p 'dired-mode)
+        (calibre-library-add-books (dired-get-marked-files))))
+
 (defun calibre-remove-books (books)
   "Remove BOOKS from the Calibre library."
   (let ((ids (mapcar #'int-to-string (mapcar #'calibre-book-id books))))

Reply via email to