Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 09-05-2022, 04:18 PM   #1
Jahlon
Member
Jahlon began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Aug 2022
Device: Kindle
Question about save to disk template

I have read about the calibre template language here but still am not sure how to do exactly what I want to do. I would like to write one template that will do the following:

If the book has a series:
{series}/{series_index:0>3s} - {title}/{title} - {authors}

but if the book has no series:
{author_sort}/{title}/{title} - {authors}

From reading about how to do conditionals, I have the following:
{series:||/{series_index:0>3s} - }{title}/{title} - {authors}

This will result in only books with series getting placed in a series subfolder, but I can't figure out how to do the "else", where when the book does not have a series it will instead get placed in an author subfolder. Is there any way to do this? Maybe it is obvious and I am just missing it...
Jahlon is offline   Reply With Quote
Old 09-05-2022, 06:57 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,025
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
chaley did this for me way back when I only had my EZReader

I made a few small changes over the years.
Code:
program:test(field('series'),strcat(
substr(field('series'), 0, 1),template("-series/{series:subitems(0,1)||/}{series:subitems(1,2)||/}{series_index:0>5.2f}-{title}_{authors}_{id}")
),template("00noseries/{author_sort[0]}_authors/{author_sort}/{title}-{authors}_{id}")
)
Since it did not have any bookshelf
I had Noseries make a folder by Author (last) Initial, then put the author in that
Similar, I had Series by letter, then name. I use 2 decimals to indicate omnibus or a short (between main) Thus the 5.2f
theducks is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Save to Disk Template Help Tanjamuse Library Management 2 08-09-2019 09:35 AM
Need help - Save to Disk template Gallips Calibre 8 06-28-2016 01:46 PM
Please help on a Save to Disk template Dammie Library Management 15 12-16-2013 09:51 AM
Need help on a Save to Disk template fidvo Library Management 2 08-12-2012 03:34 PM
save to disk template speakingtohe Calibre 9 05-29-2010 06:02 AM


All times are GMT -4. The time now is 10:17 PM.


MobileRead.com is a privately owned, operated and funded community.