View Single Post
Old 11-29-2020, 09:10 PM   #8
mfaine1
Member
mfaine1 began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Oct 2020
Device: Kindle
Yes, the copy of the book in the library. I didn't see anything specific but I'll keep looking. I did see this but I'm not really wanting to change the folder structure. Best I can tell there is no linkage to the filesystem in the database, maybe I'm wrong and I'll find out if I am. That's why you make backups


For anyone that comes to this after me, for now the easiest fix that I know is to create a shell script and run it with cron or as-needed. With the rename command this is trivial.

apt-get install rename

fix-ebook-filenames.sh:

#!/bin/bash
# Calibre won't write the directory names properly, this will correct the directory names

dir="$1"
shift

if [[ "$#" -ne 1 ]]; then
echo "A directory is required"
exit 1
fi

if [[ -d "$dir" ]]; then
cd "$dir" || exit 1
rename "$@" 's/_/\./' ./*
fi

--

Then you can run it with /path/to/fix-ebook-filenames.sh /path/to/library
Any additional command line options go to the rename command.
mfaine1 is offline   Reply With Quote