Skip to content

Commit b3b36f7

Browse files
committed
feat: add ability to edit metadata
1 parent 6b6589e commit b3b36f7

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

lib-x

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,7 @@ ${CYAN}${RESET} Read
813813
${CYAN}󰐒${RESET} Add To List
814814
${CYAN}󰐐${RESET} Remove From List
815815
${CYAN}󰗙${RESET} Remove Book
816+
${CYAN}󱚌${RESET} Edit Metadata
816817
${CYAN}󰌍${RESET} Back
817818
${RED}󰈆${RESET} Exit" | launcher "Select Book Action" | sed 's/^. //g'
818819
)
@@ -854,6 +855,34 @@ ${RED}󰈆${RESET} Exit" | launcher "Select Book Action" | sed 's/^. //g'
854855
"Back")
855856
break
856857
;;
858+
Edit\ Metadata)
859+
metadata_field=$(printf "\
860+
author_sort
861+
authors
862+
comments
863+
cover
864+
id
865+
identifiers
866+
languages
867+
pubdate
868+
publisher
869+
rating
870+
series
871+
series_index
872+
size
873+
sort
874+
tags
875+
timestamp
876+
title
877+
title_sort
878+
cover" | launcher "Select field to edit")
879+
book_id="$(echo "$book" | jq -r '.id')"
880+
calibredb show_metadata "$book_id"
881+
metadata_val=$(prompt "Enter new value for $metadata_field")
882+
calibredb set_metadata "$book_id" --field "$metadata_field:$metadata_val"
883+
calibredb backup_metadata
884+
reload_calibre_data
885+
;;
857886
"Main Menu")
858887
MAIN=true
859888
break

0 commit comments

Comments
 (0)