|
|
#1 |
|
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Mar 2018
Device: Kindle Oasis
|
Hi, I would like some help with my file naming template plz. I would like books with series to appear as:
Author (Series #03.00) Title and books with no series to appear as: Author - Title The template I have work out so far is: {authors} {series:ifempty(-)|(| }{series_index:0>5.2f|#|)} {title} which makes books with series appear correctly BUT books with out a series appear as: Author (- Title this is due to the prefix in 'series' appearing before the command 'ifempty' for some reason, and I cant get my head around how else to place the 'ifempty' or another command to use.. ALL HELP WOULD BE MUCH APPRECIATED ![]() ps: I know I can choose to have the file names all different/simpler but my aim of this post is to see if its possible to do as stated above. |
|
|
|
|
|
#2 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,166
Karma: 1410083
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
|
Code:
{authors} {series:|(| }{series_index:0>5.2f|#|)} {series:ifempty(-)} {title}
|
|
|
|
|
|
#3 |
|
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Mar 2018
Device: Kindle Oasis
|
Thankyou for the reply, I have tryed that template and the problem is that it works for those with out a series but for those with a series, it then displayes the series name twice..
|
|
|
|
|
|
#4 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,166
Karma: 1410083
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
|
Oh, my fault...
This one should work like you want Code:
program:
contains(ifempty(field('series'),'-'),'-',template('{authors} - {title}'),template('{authors} {series:|(| }{series_index:0>5.2f|#|)} {title}'));
Its working in program mode. I check for series and give back series or '-' if there is no series. contains check for '-' and use then one of the two template structures. Not elegant but works. Edit: Forgot to mention that you need to copy the complete string (both lines) in your template. You can do this direct or via the template editor Last edited by Divingduck; 03-12-2018 at 08:37 AM. |
|
|
|
|
|
#5 | |
|
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 48,443
Karma: 174510106
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
I suspect adding {author_sort}/ to the templates between the ' and the {author} would return to the default saving into author_sort folders. Code:
program:
contains(ifempty(field('series'),'-'),'-',template('{author_sort}/{authors} - {title}'),template('{author_sort}/{authors} {series:|(| }{series_index:0>5.2f||)} {title}'));
Last edited by DNSB; 03-12-2018 at 01:22 PM. Reason: Added modified code |
|
|
|
|
|
|
#6 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,166
Karma: 1410083
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
|
Quote:
Feel free to modify the code to your personal flavor/needs. It's only a example and improvements are welcome ![]() I found a lot of inspirations in the sticky post Plugboard, template, and custom composite column recipes where @chaley, @eschwartz and a lot of users showing their interesting solutions using the calibre template language. It was worth every minute I spend for reading this thread over the years. |
|
|
|
|
|
|
#7 | |
|
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Mar 2018
Device: Kindle Oasis
|
Quote:
![]() Thanks for the concern about the folders DNSB, I am using folder sorting as well but as I knew how to add that I didnt include it in the coding I was asking help for. So this is what I am using: program: contains(ifempty(field('series'),'-'),'-',template('{author_sort}/{authors} - {title}'),template('{author_sort}/{series}/{authors} {series:|(| }#{series_index:0>5.2f||)} {title}')); Sorry I dont know how to put it in a code: box Thanks again for everyones help! |
|
|
|
|
|
|
#8 | |
|
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 48,443
Karma: 174510106
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
Edit: Again bitten by replying before reading the complete thread. And yes, that thread is a great source of information. Together with the regex threads for Calibre and Sigil, among my favourite resources on Mobileread. Last edited by DNSB; 03-12-2018 at 08:22 PM. |
|
|
|
|
|
|
#9 | |
|
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 48,443
Karma: 174510106
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
Good to hear that you are a happy camper. |
|
|
|
|
|
|
#10 | |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,526
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
{authors} {series:|(| }{series_index:0>5.2f|#|)} {series:test(, - )} {title}
|
|
|
|
|
|
|
#11 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,166
Karma: 1410083
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
|
@chaley, this one is elegant.
Thanks
|
|
|
|
|
|
#12 | |
|
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Mar 2018
Device: Kindle Oasis
|
Quote:
I have another piece I would like some help with. Not sure if I should be starting a new thread or if Im right to continue here.. I would like my book series index to appear as: #01 and #01.5 when I have .x in the series at the moment I am using Code:
{series_index:0>5.2f|#|}
|
|
|
|
|
|
|
#13 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,526
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Code:
{series_index:'re(format_number($, '05.2f'), '\.00', '')'}
|
|
|
|
|
|
#14 |
|
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Mar 2018
Device: Kindle Oasis
|
PERFECT
![]() So my final template for file names, if anyone else is interested, is : Code:
{author_sort}/{series}/{series_index:'re(format_number($, '04.1f'), '\.0', '')'|#| }{title}/{authors} {series:|(| }{series_index:'re(format_number($, '04.1f'), '\.0', '')'|#|)} {series:test(, - )} {title}
Author Sort/Series/#03 Title/Author (Series #03) Title or Author Sort/Series/#03.5 Title/Author (Series #03.5) Title or Author Sort/Title/Author - Title depending on if there is a series and if the series index has a decimal Thank You eveyone who has helped and responded ![]() ... I might even be considering whether to reduce author to 'first letter first name and full last' so as to reduce file name size something for another time lol
|
|
|
|
![]() |
| Tags |
| calibre, file names, send to disk, template |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need help - Save to Disk template | Gallips | Calibre | 8 | 06-28-2016 02:46 PM |
| Please help on a Save to Disk template | Dammie | Library Management | 15 | 12-16-2013 10:51 AM |
| Need help on a Save to Disk template | fidvo | Library Management | 2 | 08-12-2012 04:34 PM |
| Saving to Disk Template | hurricane51 | Conversion | 2 | 07-07-2011 02:22 AM |
| save to disk template | speakingtohe | Calibre | 9 | 05-29-2010 07:02 AM |