10-11-2018, 01:45 PM | #1 |
Groupie
Posts: 171
Karma: 10
Join Date: Dec 2008
Device: Likebook Mars
|
Save to Disk Template with series in brackets
I'm trying to write a Save-to-disk template to save books with the filenames like:
Authors Name - [Series 3] - The Title.ext or if there's no series: Authors Name - The Title.ext But I can't see any way to avoid getting a pair of empty brackets if there is no series: Authors Name - [] - The Title.ext Is it possible? |
10-11-2018, 02:26 PM | #2 |
Well trained by Cats
Posts: 29,803
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
https://manual.calibre-ebook.com/template_lang.html
Look at the beginning of the section on Advanced Formatting You will be using those | |
10-11-2018, 03:03 PM | #3 |
Groupie
Posts: 171
Karma: 10
Join Date: Dec 2008
Device: Likebook Mars
|
I already read that. It works so you only have one " - " between the author and title if there is no series, but I tried all sorts and could not get it to work with brackets in it.
Edit: After re-reading it 4 more time and another 8 attempts, I finally got it to work. Code:
{authors} {series:| - [|} {series_index:||]} {title:| - |} Last edited by Vortex; 10-11-2018 at 05:44 PM. |
10-11-2018, 04:42 PM | #4 |
hopeless n00b
Posts: 5,111
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
|
Code:
{authors:|| - }{series:|[|}{series_index:| |] - }{title} authors - [series title if there's no series_index. Too lazy to check the template documentation how to properly handle series without series_index. |
10-11-2018, 05:26 PM | #5 |
Grand Sorcerer
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
It should not be possible to have a series without a series_index. What do you see if you edit metadata for a book in that state? What happens if you run calibre's database check?
|
10-11-2018, 05:39 PM | #6 | |
null operator (he/him)
Posts: 20,570
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
BR |
|
10-11-2018, 05:41 PM | #7 |
Groupie
Posts: 171
Karma: 10
Join Date: Dec 2008
Device: Likebook Mars
|
Just noticed that the template is moving the series article to the end after a comma. How do I stop it doing that?
For example in Calibre my series name displays as: The Series [3] A Series [2] An Awful Series [1] (I think I turned appending the article off in Tweaks once long ago) But the template above saves as: - [Awful Series, An 1] - |
10-11-2018, 05:55 PM | #8 | |
null operator (he/him)
Posts: 20,570
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
You maybe thinking of the Title/Series sorting tweak relating to articles BR |
|
10-11-2018, 06:31 PM | #9 |
Groupie
Posts: 171
Karma: 10
Join Date: Dec 2008
Device: Likebook Mars
|
Thanks BR, Oddly It's still exporting with the series articles at the ends.
After making the change to the tweak I restarted calibre, and went back in to make sure it had stayed changed. Double checked that I had changed the correct tweak and re-tried it several times, but it's still exporting with appended series articles. Last edited by Vortex; 10-11-2018 at 06:50 PM. |
10-11-2018, 06:59 PM | #10 |
null operator (he/him)
Posts: 20,570
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Hmmm
Using library_order and strictly_alphabetical with this template Code:
{authors} {series:| - [|} {series_index:||]} {title:| - |} BR Last edited by BetterRed; 10-11-2018 at 07:34 PM. Reason: attach uncropped image |
10-11-2018, 07:02 PM | #11 |
hopeless n00b
Posts: 5,111
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
|
That was just a theoretical example. I've forgotten Calibre automatically assigns series_index. Been a while since I dealt with series.
|
10-12-2018, 06:15 AM | #12 | |
Groupie
Posts: 171
Karma: 10
Join Date: Dec 2008
Device: Likebook Mars
|
Quote:
Code:
# Control sorting of titles and series in the library display title_series_sorting = 'library_order' Also is it 'strictly_alphabetical' or as you said yesterday 'strictly_alphabetic' ? Neither makes any difference though. Kovid Goyal - The Calibre Documents 1 - DOCX Demo.epub saves as: Kovid Goyal - [Calibre Documents, The 1] - DOCX Demo.epub |
|
10-12-2018, 06:25 AM | #13 |
ɴₐɴ
Posts: 421
Karma: 2507940
Join Date: Jun 2011
Location: 37.2N 93.3W
Device: KV PW4 PW3 PW2
|
Code:
# Control formatting of title and series when used in templates save_template_title_series_sorting = 'strictly_alphabetic' Edit: BR already posted this... Make sure you are changing save_template_title_series_sorting Last edited by JimmyR; 10-12-2018 at 06:30 AM. Reason: Add Info |
10-12-2018, 07:01 AM | #14 | |
null operator (he/him)
Posts: 20,570
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
BR |
|
10-12-2018, 10:16 AM | #15 | |
Groupie
Posts: 171
Karma: 10
Join Date: Dec 2008
Device: Likebook Mars
|
Quote:
These are my settings for those 2 Tweaks: Still saving to disk with the appended articles in the filenames. Last edited by Vortex; 10-12-2018 at 10:21 AM. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with template and save to disk | elfnor | Library Management | 10 | 07-30-2023 10:09 PM |
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 |