From 1f288a450d4677d61bd556c711ba81d6fa56192e Mon Sep 17 00:00:00 2001 From: Steven Saus Date: Thu, 7 Mar 2024 02:27:47 -0600 Subject: [PATCH] updating book_search to use calibre's db --- book_search_preview.sh | 11 +++++++++++ books_search.sh | 18 ++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100755 book_search_preview.sh diff --git a/book_search_preview.sh b/book_search_preview.sh new file mode 100755 index 0000000..06449f6 --- /dev/null +++ b/book_search_preview.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +Instring="$@" +ID=$(echo "${Instring}" | awk '{print $1}') +#Command=$(echo "$Instring" | sed 's/ (/./g' | sed 's/)//g' | sed 's/:man:/:man -Pcat:/g' | awk -F ':' '{print $2 " " $1}') +# install unhtml from pacakage manager +if [ -f $(which unhtml) ];then + calibredb show_metadata "${ID}" | unhtml +else + calibredb show_metadata "${ID}" +fi diff --git a/books_search.sh b/books_search.sh index 7f67c57..a37e32e 100755 --- a/books_search.sh +++ b/books_search.sh @@ -27,6 +27,24 @@ # You can also regenerate it immediately before a run by using the -r switch # # Use -m to utilize ebook metadata instead of the file structure mentioned above. +# +# add in subject from exiftool (may need to add cpan install Activity::Zip (I think?) for tags +# +# +# Why wasn't I using this??? +# calibredb list -f authors,formats,cover,tags,series,series_index,title --separator § +# id is first row, so can run multiple times to attach id to each of these. Or maybe feed into +# memory dynamically for fzf? That's probably better, innit? +# calibredb list -f authors,formats,cover,tags,series,series_index,title --separator § +# # need check for multi-format +# # preview window for cover and/or summary? + #With Preview +#SelectedFile=$(cat "$CacheFile" | fzf --no-hscroll -m --height 80% --border --ansi --no-bold --preview="$SCRIPTDIR/quite-intriguing-preview {}" | sed 's/ (/./g' | sed 's/)//g' | sed 's/:man:/:man -Pcat:/g' | awk -F ':' '{print $2 " " $1}' +# +#calibredb list -f title,authors | fzf +x -e -i --header-lines=2 --preview="notify-send {}" + +# +# use both so can use whatever backend, even without calibre at all. ##############################################################################