View Single Post
Old 07-01-2017, 10:10 AM   #2545
Ruskie_it
Fanatic
Ruskie_it ought to be getting tired of karma fortunes by now.Ruskie_it ought to be getting tired of karma fortunes by now.Ruskie_it ought to be getting tired of karma fortunes by now.Ruskie_it ought to be getting tired of karma fortunes by now.Ruskie_it ought to be getting tired of karma fortunes by now.Ruskie_it ought to be getting tired of karma fortunes by now.Ruskie_it ought to be getting tired of karma fortunes by now.Ruskie_it ought to be getting tired of karma fortunes by now.Ruskie_it ought to be getting tired of karma fortunes by now.Ruskie_it ought to be getting tired of karma fortunes by now.Ruskie_it ought to be getting tired of karma fortunes by now.
 
Posts: 536
Karma: 1000000
Join Date: Dec 2011
Location: Rome, Italy
Device: Kindle PW5, Kindle PW4, Kindle 4 NT
Perhaps it should go like that:

Code:
# Check if the book was a KFX...
if [ "${last_read_mime}" == "application/x-kfx-ebook" ] ; then
	# We want the metadata sidecar file, not the book itself...
	last_read_kfx="${last_read_file%.*}.sdr/assets/metadata.kfx"
	# Check that it exists...
	if [ ! -f "${last_read_kfx}" ] ; then
		last_read_kfx = last_read_file
	fi
	# Use KFX Meta.
	...
That is, if the metadata.kfx sidecar does not exist, then pass to the kfxmeta.py the file itself.

Anybody of good will can validate the syntax at least?
Ruskie_it is offline   Reply With Quote