View Single Post
Old 03-25-2025, 07:35 PM   #16
Incanus
Incanus
Incanus doesn't litterIncanus doesn't litterIncanus doesn't litter
 
Incanus's Avatar
 
Posts: 313
Karma: 210
Join Date: Oct 2017
Location: Chile
Device: Boyue Likebook T80D
Template Editor Program and Save To Disk Settings To Export Ebooks For Calibre Sync

And the plot thickens...

Calibre Sync (further on: CS) has a few additional quirks that I had to solve in order to progress on my "Save to Disk and then copy to device instead of downloading form CS" solution:
  1. No special characters on the title or the author: solved with a Save To Disk setting:
    Code:
    Convert non-English characters to English equivalent
  2. Only the first author listed: already solved with
    Code:
    {author:sublist(0,1,&)}
  3. The title on the file name contains only the first 32 letters of the title
  4. The title must appear in its "raw" or "format unsorted":
    Code:
    $$title

The only way to do all of this was to actually code a program in the template editor, wich now looks like this:

Code:
program:
title_raw = $$title;
title_short_32_chars = substr(title_raw, 0, 31);
author_first = sublist($author, 0,1,'&');
file_name = title_short_32_chars & ' - ' & author_first & '_' & $uuid
I'm testing it (export a bunch of ebooks, copy to device and see what CS says it's now downloaded) but I think this covers about 98% percent of any ebook otherwise downloaded from CS: the remaining 2% of my library I will download from CS connected to the Calibre content server running from my Calibre Windows 10 installation.

I'm now giving my heartfelt thanks to everyone who had the patience to read my gibberish, make their suggestions and nudge me in the right direction.

Gratefully yours,

Last edited by Incanus; 03-26-2025 at 12:51 PM.
Incanus is offline   Reply With Quote