View Single Post
Old 01-19-2015, 03:00 PM   #1
danjcla
Junior Member
danjcla began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jan 2015
Device: Kindle Paperwhite
Unhappy fw5.6.1+ — Is abuse of the author field only option for library management?

Is abusing either the title or author field - along the lines of the below proof-of-concept script - pretty much the only way to do off-device / non-manual organization of books on a Kindle Paperwhite 2 with firmware 5.6.1 (that hadn't previously been rooted)?

I've read a lot of stuff on these forums and that would seem to be the case, but I haven't found a post that says it point blank, so thought I'd ask, and also share the atrocious ugliness below :-)

Code:
#!/bin/bash



# This script changes the author metadata to be in this form with <> as 
# the delimiter:
# <>directory the book is in<>original author name<>

# -->> Need to be made idempotent before it'll be really usable day-to-day

# It'd also be useful to add "X of Y" to files in a directory, so it'd be easy
# to manually make sure everything in a directory is also in a collection.



EBOOKMETA="/Applications/calibre.app/Contents/MacOS/ebook-meta"
# http://manual.calibre-ebook.com/cli/ebook-meta.html

find /Volumes/Kindle -type f -name '[a-zA-Z0-9]*.mobi' -print0 | while read -d $'\0' FILE
do
  AUTHOR="$(/Applications/calibre.app/Contents/MacOS/ebook-meta "$FILE" --to-opf=/dev/null | grep ^Author | sed 's/Author(s)           : //g')"
  FOLDER="$(basename $(dirname "$FILE"))"
  $EBOOKMETA "$FILE" -a "<>$FOLDER<>$AUTHOR<>"
done

Last edited by danjcla; 01-19-2015 at 03:08 PM.
danjcla is offline   Reply With Quote