%s
%d\n" status (length group-books))) (dolist (book group-books) (let ((selected (equal (plist-get book :id) selected-id))) (insert (format "\n"
(if selected " spine-selected" "")))
;; Format glyph (emoji)
(let ((fmt (plist-get book :format)))
(insert (format "%s\n"
(cond ((equal fmt "hardcover") "๐")
((equal fmt "ebook") "๐ฑ")
((equal fmt "audiobook") "๐ง")
(t "")))))
;; Title + author
(insert "")
(insert (spine--h (plist-get book :title)))
(let ((author (plist-get book :author)))
(when author
(insert (format " %s"
(spine--h author)))))
(insert "\n")
;; Tags
(let ((tags (plist-get book :tags)))
(when tags
(insert (format "%s\n"
(mapconcat (lambda (tag) (concat ":" tag ":"))
tags " ")))))
;; Recommendation trail
(let ((rec-by (plist-get book :rec_by))
(rec-note (plist-get book :rec_note)))
(when (and rec-by (> (length rec-by) 0))
(insert
(format "%s%s\n"
(spine--h rec-by)
(if (and rec-note (> (length rec-note) 0))
(concat ": " (spine--h rec-note))
"")))))
;; Status pill
(let ((status (or (plist-get book :status) "WANT")))
(insert (format "%s\n"
(downcase status) (downcase status))))
;; Expanded detail
(when selected
(insert "
\n"))))))
(insert "\n") (dolist (note (plist-get book :notes)) (insert (format "\n")) (insert "[%s] %s
\n" (spine--h (car note)) (spine--h (cadr note))))) (let ((parts nil)) (let ((rating (plist-get book :rating))) (when (and rating (> (length rating) 0)) (push (format "Rating: %s/5" (spine--h rating)) parts))) (let ((isbn (plist-get book :isbn))) (when (and isbn (> (length isbn) 0)) (push (format "ISBN: %s" (spine--h isbn)) parts))) (let ((fmt (plist-get book :format))) (when (and fmt (> (length fmt) 0)) (push (format "Format: %s" (spine--h fmt)) parts))) (let ((added (plist-get book :added))) (when (and added (> (length added) 0)) (push (format "Added: %s" (spine--h added)) parts))) (when parts (insert (format "\n" (mapconcat #'identity (nreverse parts) " ยท "))))) (insert "