For future reference, the next calibre release (8.7 or a preview) will contain a template function that can do what the python template does.
formats_path_segments(with_author, with_title, with_format, with_ext, sep)
return parts of the path to a book format in the calibre library separated by ``sep``. The parameter ``sep`` should usually be a slash (``'/'``). One use is to be sure that paths generated in Save to disk and Send to device templates are shortened consistently. Another is to be sure the paths on the device match the paths in the calibre library.
See the manual for full documentation.
|