View Single Post
Old 01-16-2021, 03:07 PM   #5
Primus_Pilus
Supervillain Consultant
Primus_Pilus began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Sep 2018
Device: BOOX 10.3, Kobo Aura ONE, Aura H2O
How to make imports faster

I run a 15,000 book library across all my devices and finally had to break down and read the CC documentation. There is an articule out there with a specific filename setup that actually appears to have a bug in it.

This filename path will setup the android filesystem and CC for faster search indexing and installation of files.

{first_author:%.1s}/{first_author}/{first_author}-{title}

%1.1s <--- in the guide is actually incorrect

Will generate this
<default location path>/R/Ringo/Ringo-When The Devil Dances.epub

Quote:
Basic syntax
The columns allowed are:
{title}, {title_sort} (title is the real title. No articles are moved)
{authors}, {first_author}, {author_sort}, {first_author_sort}
{series}, {series_index}
{id} (the calibre database identifier, which is a number)
text-type custom columns {#col_lookup_name}
(CC version 4.3.4 and later) custom series columns. A custom series lookup name such as #series returns the custom series name without the index, and the lookup name with _index appended (e.g., #series_index) returns the custom series index as a number.

A format specifier is a string beginning with a % character and ending with a format type character. Examples:
%d -- format as an integer
%04d -- format as an integer four digits long and zero-filled
%06.2f -- format as a floating point number 6 characters wide, zero-filled, with 3 digits to the left of the decimal point and 2 digits to the right of the decimal point.
%.10s -- format as a string to be at most 10 characters long.
There's more including data on IF/THEN else statements in making the files but this seems to make them fast enough

If I wanted to make a file path library that other android book readers could leverage then I might consider this one

{#myshelves:%.1s}/{#myshelves}/{series}-{series_index}-{first_author}-{title}

Based on the Calibre documentation if there is no series created in your Calibre database then the above string will return a filename like this

{#myshelves:%.1s}/{#myshelves}/{first_author}-{title}

As apparently Calibre / CC removes leading empty fields and dashes.

Tinker with it and you should find something you can make work.



A quick field in Calibre to make a series Yes/No can be constructed easily

Calibre toolbar
Preferences | Add your own columns
+ (add new column)
Lookup Name: series_question
Column Heading: Series?
Column Type: Column built from other columns
Show checkmarks (check this box)
TEMPLATE: program: if field('series') then 'yes' else 'no' fi

Create that and then CC can use #series_question for if/then logic building filenames and constructing your path and filename setup.

The complicated way ...
Example
CC Filename option
:if: {#series_question} :then: {#myshelves:%.1s}/{#myshelves}/{series}-{series_index}-{first_author}-{title} :else: {#myshelves:%.1s}/{#myshelves}/{first_author}-{title}

Last edited by Primus_Pilus; 01-16-2021 at 04:07 PM.
Primus_Pilus is offline   Reply With Quote