View Single Post
Old 01-25-2013, 11:54 AM   #27
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 5,904
Karma: 1216548
Join Date: Jan 2010
Location: France
Device: Many android devices
How can I use the same file name for content server and wireless device connections?

There are two solutions to ensuring that file names for a book are the same on multiple devices regardless of the delivery path.

Solution 1

Tell calibre to use a template that reproduces (in almost all cases) the file name that CC generates. The template is
Code:
{title} - {authors:'re($, '[^-\w& ]', '_')'}
Enter this template by connecting as a wireless device, then in calibre right-click on the device button, choose "Configure this device", and pasting the template into the "Save template" box.

Two caveats: 1) the template generates the same file name as CC as long as the sum of the length of the authors and the title is less than approximately 180 characters. If the sum exceeds that value then both CC and calibre will shorten the file name. They use different methods for shortening, so the results will be different. 2) calibre could change some other unusual characters because they are illegal in some situations.

Solution 2

CC has an option to use calibre's book identifier (its Unique ID, or UUID) as the file name. If the option is checked, both CC and calibre will use the UUID as the file name, which is guaranteed to be the same value for a book no matter how it is delivered or if the title and author are changed.

Solution 2 overrides the template, so there is no reason to use both solutions 1 and 2 at the same time.

Note: Starting with calibre 0.9.15, sending a book to the device that calibre knows is already on the device will not create a new file. Instead it will overwrite the existing file, preventing having multiple copies of the book on the device. If you don't want this behavior, either delete the existing copy before sending the new one or change an option in calibre to disable the check if the file already exists. To change the option, connect as a wireless device, then in calibre right-click on the device button, choose "Configure this device", and uncheck the option "Replace books with same calibre identifier". Unfortunately, this change does not help if you want to have the same file name across multiple devices, no matter how the file arrived on the device. You might want this if you are using a reading app that is capable of syncing reading positions across devices, such as Moon+. Solution 2 works the best in this situation.

Last edited by chaley; 03-20-2014 at 01:31 PM.
chaley is offline