Creating the top-level #shelf (genre) directories didn't always work when the complete path and filename were still very long. I decided which information I needed to find titles as well as reconstruct them on another system (data recovery), and compromised.
Since my koreader filesystem view contains the metadata, I whittled down the file paths and names to have only this:
Code:
books/{#shelf:||/}{series:||/}{author_sort:sublist(0,1,&)}-{series_index:re(^(\d)(\.|$),0\1\2)||-}{title:sublist(0,1,:)}
A 5th history book by John Smith, Shawn Frank, & Dan Brown in a series about pirates would become:
PHP Code:
books/History/Great_Pirates/Smith,_John-05-Samuel_Bellamy_for_President.epub
A non-serial book of Poetry titled: "Nobody Bought This: Because Quite Frankly I'm Not That Great a Poet and Should Have Finished My Degree" becomes:
PHP Code:
books/Poetry/Me,_Author-Nobody_Bought_This.epub
Then, I generate a Calibre catalog and place it at the top level.
The bit I'm working on is "personal" documents. I manage some documents with Calibre that I don't need to show beneath ~/books. I have a yes/no column to mark these as "personal." Currently, I give them the #shelf "personal," and they appear as
PHP Code:
~/books/personal/document.txt
I'd prefer to have them saved as
PHP Code:
~/personal/document.txt
I can't get a template correct that generates a new top-level path based on a boolean field.